-
Notifications
You must be signed in to change notification settings - Fork 941
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
Add editorconfig-checker
#221
Add editorconfig-checker
#221
Conversation
ddaf464
to
83873b5
Compare
83873b5
to
39cb9e4
Compare
Any news on this? |
@mstruebing this is interesting... |
As long as the |
# Lint the files with editorconfig # | ||
#################################### | ||
# LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" | ||
LintCodebase "EDITORCONFIG" "editorconfig-checker" "editorconfig-checker" "^.*$" "${FILE_ARRAY_ENV[@]}" |
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.
Is this going to lint all dotfiles?
Is this linter supposed to lint all dotfiles? Or just the .editorconfig files?
Ex: should this lint .gitignore ? It looks like it will.
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.
Isn't that a regex which says: "start with any character n times and then end"?
So it will lint all files, by that it will consider your .editorconfig
file if present.
So to be clear: the .editorconfig
is the file which describes how your files should be formatted (basically, tabs/spaces, spaces amount, line ending character, like that), which can be used for any filetype and programming language. It's language agnostic. You can have wildcard rules or make rules for specific files or file globs.
So it will lint every file.
Does this explain it properly?
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.
I misread the regex. Sorry. You are correct that pattern will match any file in the repo.
So my question then changes: Is this linter meant to lint .editorconfig
files, or is it meant to check that all files comply with the settings specified in the .editorconfig
that applies to them?
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.
It's exactly the second one. It checks that your files comply with your settings specified in .editorconfig
.
Sorry for not explaining it properly.
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.
This makes more sense. What happens in a repo with no .editorconfig
?
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.
No error should occur, if there is no definition for a specific check it is skipped and not assuming something defaultish.
@@ -0,0 +1,3 @@ | |||
some line |
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.
Depending on the answers to my other questions these files might need to be split into subfolders named good and bad, and the files might need to be named .editorconfig
in each folder.
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.
See above
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.
Makes sense now with the other conversation we've had.
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.
I like the ideas here. This branch has fallen a little behind (development in this repo is turned up to 11 right now). Can you rebase on the current master and resolve the conflicts?
39cb9e4
to
aba4c14
Compare
Currently rebased :) |
f9e8792
to
0075e70
Compare
0075e70
to
9a83876
Compare
resolved conflicts caused by the html PR getting merged in first. |
@nemchik Do you believe this one is ready? |
LGTM. |
fixing up my merge mistakes and then sending this through if it passes CI. |
see: https://github.com/editorconfig-checker/editorconfig-checker/
I hope this kind of linter is allowed as it is not for linting a specific language.