-
Notifications
You must be signed in to change notification settings - Fork 18
nit(editorconfig): add .editorconfig
#91
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
base: main
Are you sure you want to change the base?
Conversation
|
Hmm, did not trip locally on the Python files. I will leave this as a question regarding line length. It seems Line 2 in 9953522
I used the pre-commit hook manually:
|
2cbe1c8 to
a96d642
Compare
|
Matched line length to changes in #96. |
|
Hmm, there seems to be some formatting change in the pre-commit-config, causing the whole file to be diffed - any idea why is that? Also, CI fails |
Yes, that's a part of the note in the OP. The file contains This is a bit why the following happens:
That mix of I will need to rebase on the recent |
editorconfig is a simple, project-level configuration file (located in `.editorconfig`) that defines basic editor settings (indentation, character set, line endings, trailing whitespace, final newline, etc.) per file type so that editors and IDEs can automatically enforce consistent formatting across a codebase. It is transparently supported by most major editors/IDEs. While `pre-commit` is in use for checking that certain style guidelines are followed, editorconfig can automatically configure the user's editor or IDE to use those style parameters when they are editing -- potentially saving the headache of noticing that they've written something outside of those style requirements later on. This commit also adds a checker to `pre-commit` to doublecheck that those guidelines were followed by the editor/IDE. The guiding principle for this submission was to follow the existing apparent style choices used in the repository, covering only those files which exist therein. Coincidentally, the `.pre-commit-config.yaml` had CRLF line endings, unlike any other file. This was also fixed. feat(editorconfig): add `.editorconfig` editorconfig is a simple, project-level configuration file (located in `.editorconfig`) that defines basic editor settings (indentation, character set, line endings, trailing whitespace, final newline, etc.) per file type so that editors and IDEs can automatically enforce consistent formatting across a codebase. It is transparently supported by most major editors/IDEs. While `pre-commit` is in use for checking that certain style guidelines are followed, editorconfig can automatically configure the user's editor or IDE to use those style parameters when they are editing -- potentially saving the headache of noticing that they've written something outside of those style requirements later on. This commit also adds a checker to `pre-commit` to doublecheck that those guidelines were followed by the editor/IDE. The guiding principle for this submission was to follow the existing apparent style choices used in the repository, covering only those files which exist therein. Coincidentally, the `.pre-commit-config.yaml` had CRLF line endings, unlike any other file. This was also fixed. diff --git a/.editorconfig b/.editorconfig index 06b892a..279e5aa 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,7 +15,7 @@ indent_size = 1 [*.py] indent_style = space indent_size = 4 -max_line_length = 79 # PEP 8 recommendation +max_line_length = 320 # matches `ruff` configuration [*.{yml,yaml}] indent_style = space
2f452c8 to
027321b
Compare
…ing issues nit(repo): renormalize line endings `CR-LF` -> `LF`, fix file formatting issues
3211562 to
c3cb169
Compare
|
Okay, all updated. Of course, I am in no rush. This technically touches quite a few files, but most of them will look like identical content diffs. This is because their line endings were normalized to Unix-style ( I am aware that's an invisible change, but it seems a lot of files got checked in with a mixture of endings. I'm not sure how that happens, but it does slip by sometimes. As a means of preventing that in the future, there is a new Summary of Changes
|
This follows from the suggestion here: #87 (comment)
editorconfig is a simple, project-level configuration file (located in
.editorconfig) that defines basic editor settings (indentation, character set, line endings, trailing whitespace, final newline, etc.) per file type so that editors and IDEs can automatically enforce consistent formatting across a codebase.It is transparently supported by most major editors/IDEs.
Most often, nothing new is required on the developer's part -- no installing tools, no changing settings.
While
pre-commitis in use for checking that certain style guidelines are followed, editorconfig can automatically configure the user's editor or IDE to use those style parameters when they are editing -- potentially saving the headache of noticing that they've written something outside of those style requirements later on.This commit also adds a checker to
pre-committo double-check that the editor/IDE followed those guidelines.The guiding principle for this submission was to follow the repository's apparent style choices, covering only the files that exist therein.
Note
Coincidentally, the
.pre-commit-config.yamlhadCRLFline endings, unlike any other file. This was also fixed.This will appear in the changes as the file being entirely deleted and re-added (to change
CRLF->LFline endings). A close review will show that nothing was changed except the addition of the editorconfig checker. 😅As always, I am open to changing this in any way to accommodate preferred style choices.