-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add EditorConfig file #1022
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 file #1022
Conversation
3e9789d to
b9d0072
Compare
spacewander
left a comment
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.
Can we add a job to check it in the CI?
|
Is there anything in particular you wish to check? For consistent formatting for all of the files then maybe shfmt can be added in a different PR with CI. But EditorConfig isn't really the tool for that and there doesn't exist any first-party tools for checking EditorConfig rules. |
|
Some search brings me to https://github.com/editorconfig-checker/editorconfig-checker. |
|
|
|
What are your thoughts on shfmt? |
|
I don't like a formatter, which forces other people to use a style that is not used in their daily life. |
|
Fair enough - I don't use shfmt either. How about adding |
LGTM |
b9d0072 to
63492c6
Compare
|
Epic 👍 I also changed Ubuntu version since 18.04 is being currently phased out with brownouts |
63492c6 to
0e59821
Compare
.github/workflows/ci.yml
Outdated
| steps: | ||
| - name: 'Get Changed Files' | ||
| id: 'files' | ||
| uses: 'jitterbit/get-changed-files@v1' |
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 see some warnings in https://github.com/tj/git-extras/actions/runs/3979079395/jobs/6821262963
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Can it be avoided?
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 switched to masesgroup/retrieve-changed-files@v2, which fixed this issue
.github/workflows/ci.yml
Outdated
| branches: [master] | ||
| pull_request: | ||
| branches: [ master ] | ||
| branches: ['*'] |
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.
Let's change it back once this PR is approved.
21588bb to
ca1b05e
Compare
ca1b05e to
cb46695
Compare
|
The lint checks work with the new changes. I also changed the |
They can check this locally? It would be good to add an editorconfig plugin in the editor. Anyway, they can also figure it out by reading the output of the CI. |
|
Oh oops 🤦 - for some reason I thought that CI wouldn't run if Is this ready to go? |
Merged. Thanks! |
While working on #1021, I noticed that some files like git-delta don't end in a newline. As a result, that last "line" (
git diff --name-only --diff-filter=$filter $branch) is not considered part of the text file, according to POSIX.To fix this, I propose adding an EditorConfig file. When editors read this (some require a plugin like VSCode) file, it adjusts the formatting based on the rules. One thing to note is that rules that specify whitespace are only take affect to each inserted text. For example, with
indent_style = space, when editing a file that predominately uses tabs, only the spaces will be inserted on each<tab>- other characters are not modified.It seems both 2 and 4-space shell scripts are used in this repository, so I decided to omit that constraint from the
.editorconfigfile.