-
Notifications
You must be signed in to change notification settings - Fork 943
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
Editorconfig special case #391
Editorconfig special case #391
Conversation
https://github.com/github/super-linter/pull/221/files#diff-c7b422f2f140a91b67618e5aa86d8d88R477 your link seems incorrect |
I am guessing this branch was based on the branch used in https://github.com/github/super-linter/pull/372 |
Yes sorry, my mistake, it is fixed now |
I think it should be done to not run the editorconfig-checker when no To hide it behind a flag: I think it is okay because it is somehow a bit different behaviour than other linters of this project. |
Agreed.
Seems like a typo. |
lib/validation.sh
Outdated
############################# | ||
# Editorconfig special case # | ||
############################# | ||
LINTER_RULES_PATH="${LINTER_RULES_PATH:-.github/linters}" # Linter Path Directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am understanding this correctly, if users don't set LINTER_RULES_PATH
manually it'll be set to .github/linters
and if there is an .editorconfig
there then the linter will still run?
Logically I think it makes more sense to not include this block of changes and instead change the logic here https://github.com/github/super-linter/pull/391/files#diff-c7b422f2f140a91b67618e5aa86d8d88R495 to if [ -f "$GITHUB_WORKSPACE/.editorconfig" ];
This was for debugging purpose while developing, I think I missed to remove it and it doesn't get caught while reviewing. |
Filed #395 for the |
LGTM now. |
@GaboFDC @nemchik @mstruebing amazing work in here all! |
Following the logic from here if we don't specify any linter flag (i.e use all linters) then, editorconfig will run against the entire code base, even if there is no
.editorconfig
present, and it will even check the.git/
folder.Proposed Changes
In some sense this is expected because we are not specifying any linter, so all should be run. But as this one is special and lints the entire code base, I think is worth putting an extra check to only do it if either the flag is set, or
.editorconfig
is present as a special case because this behavior is different from other linters (run only against files from that extension/type).I'm open to all feedback here. specially @mstruebing
PD: I think another needed change (independent of this one) is to exclude
.git/
from editor config.PD2: Not sure if this is a typo or what is the purpose of this?
Readiness Checklist
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance