megalinter
megalinter copied to clipboard
`EXTENDS` in `.mega-linter.yml`: Properties from extended file override properties in extending file
Describe the bug
To simplify the configuration of MegaLinter across multiple repos I want to have one base config in my .github
repo and then have a short configuration in each other repo that adds properties or overrides the ones from the base config. For example, in one repository I want to override the FILTER_REGEX_EXCLUDE
property:
EXTENDS: https://raw.githubusercontent.com/lars-reimann/.github/main/.mega-linter.yml
# Config
FILTER_REGEX_EXCLUDE: (\.github/workflows/|someOtherFolder/)
However, this does not seem to work as expected: The FILTER_REGEX_EXCLUDE
property from the extended config overrides the property defined here rather than the other way around. This means the base config can only contain properties that I know I'll never want to override.
To Reproduce Steps to reproduce the behavior:
- Create a base config.
- Create another config that extends the base config and overrides one of its properties.
- Observe the behavior of the linter.
Expected behavior The property in the extending file should have precedence.
Additional context At first glance this seems to cause this behavior: https://github.com/megalinter/megalinter/blob/100a4d937a48c79e0eb5de8325d4d2b22601d861/megalinter/config.py#L82
This should indeed be the contrary: local config that overriddes default config from extended file ^^ I check
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
Should probably stay open.
Agreed :) Sorry i'm very busy on preparing v6 these days ^^
No worries, looking forward to v6.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.