Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXTENDS in .mega-linter.yml: Properties from extended file override properties in extending file #1516

Closed
lars-reimann opened this issue Jun 7, 2022 · 7 comments · Fixed by #2020
Assignees
Labels
bug Something isn't working nostale This issue or pull request is not stale, keep it open

Comments

@lars-reimann
Copy link
Contributor

lars-reimann commented Jun 7, 2022

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:

  1. Create a base config.
  2. Create another config that extends the base config and overrides one of its properties.
  3. 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

@lars-reimann lars-reimann added the bug Something isn't working label Jun 7, 2022
@nvuillam
Copy link
Member

nvuillam commented Jun 8, 2022

This should indeed be the contrary: local config that overriddes default config from extended file ^^
I check

@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2022

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.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jul 9, 2022
@lars-reimann
Copy link
Contributor Author

Should probably stay open.

@nvuillam
Copy link
Member

nvuillam commented Jul 9, 2022

Agreed :)
Sorry i'm very busy on preparing v6 these days ^^

@nvuillam nvuillam removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jul 9, 2022
@lars-reimann
Copy link
Contributor Author

No worries, looking forward to v6.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2022

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.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Aug 9, 2022
@nvuillam nvuillam removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Aug 9, 2022
@Kurt-von-Laven Kurt-von-Laven added the nostale This issue or pull request is not stale, keep it open label Aug 17, 2022
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Sep 17, 2022
@Kurt-von-Laven Kurt-von-Laven removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Sep 17, 2022
Kurt-von-Laven added a commit that referenced this issue Oct 30, 2022
Ensure that local config keys overwrite inherited config keys rather
than the other way around.
Kurt-von-Laven added a commit that referenced this issue Oct 30, 2022
Ensure that local config keys overwrite inherited config keys rather
than the other way around.
@Kurt-von-Laven Kurt-von-Laven self-assigned this Oct 30, 2022
Kurt-von-Laven added a commit that referenced this issue Oct 30, 2022
Ensure that local config keys overwrite inherited config keys rather
than the other way around.
nvuillam added a commit that referenced this issue Oct 31, 2022
* Correct casing from "VsCode" to "VSCode"

* Document EXTENDS inheritance order

* Correct behavior of EXTENDS (#1516)

Ensure that local config keys overwrite inherited config keys rather
than the other way around.

* fix jscpd config

quick build

Co-authored-by: nvuillam <nicolas.vuillamy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nostale This issue or pull request is not stale, keep it open
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants