-
-
Notifications
You must be signed in to change notification settings - Fork 149
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 #821
Add editorconfig #821
Conversation
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.
Do you feel that this adds much over the existing autoformatting (via pre-commit + ruff)? It feels more natural to me to have just a single place that handle this.
.editorconfig
Outdated
[*.toml] | ||
max_line_length = 150 | ||
indent_size = 4 | ||
|
||
[*.yml] | ||
max_line_length = 120 | ||
indent_size = 2 |
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'd cut these two. Right now we rarely use either kind of file and both are unformatted.
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 is for editors, not formatters. The indent size tells the editor how many spaces to add when "tab" is pressed. I got rid of the line length then.
editorconfig automatically configures editors like vim, emacs, etc. so that they know how to save files, how long the lines should be (for examples, vim's automatic line width formatter), where to show the line length helper. The problem is that I have my editor configured differently than yours. With this file, my editor automatically adjusts to your configuration. |
4cd7230
to
f17864c
Compare
Indeed, I'm familiar with My point is that if we care about such things then IMO it'd be better to have a single source of truth on such matters -- an autoformatter -- and allow anything at all whilst editing. Anyway, not a strong opinion. |
ea73e65
to
03309ae
Compare
03309ae
to
099ffd6
Compare
Yes, I see your point. I guess I forgot that you've got the auto-formatter enabled. Anyway, updated as requested. |
Alright, merged! :) Thank you for the contribution! |
Thanks for being flexible about this :). Maybe we should propose to Ruff that editorconfig be the defaults to satisfy your "one source of truth" desire? |
Seems not planned: astral-sh/ruff#1530 |
Ah, nice find! |
No description provided.