-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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 enforcement for PR is counterproductive #121027
Comments
Because we can't enforce it client side. |
Now we're back to my original point for which you provided an argument that it's automatic anyway so there's no need for empathy? |
Yes? We expect people to format commit messages a certain way, we expect ofborg to pass eval, we (usually) expect builds to pass. Why is not introducing whitespace, trailing newlines and tabs such an inconvenience? With the action it is at least consistent, we have rules and they are followed. Without the action it's a free for all, sporadically enforced by reviewers and contributors. Is that a better experience for contributors, having some people asking for fixes and others ignoring it? |
Good question. We already specify too many rules, so adding extra ones means we have to be conscious that each rule adds cognitive and work overhead to each contribution. Having extra whitespace has absolutely no downsides development-wise. If it disturbs people where the editor highlights trailing whitespace, disable that and you're done.
Reviewers shouldn't nitpick. |
https://github.com/NixOS/nixpkgs/pull/86376/files This is the PR that caused the |
Odd side -- extra whitespaces and trailing newline add/removal create unnessesary diffs |
It's not, because it didn't waste 200 contributors' time and it was done once. |
I see the following options to resolve the current situation:
|
Just to have some numbers: The check has run 44,175 times. It's errored (requiring further action) 1500 times. |
If it's not a nitpick how do we prevent similar things from being merged again? Also those ~200 files we then edited by other people, some of who readded the removed newlines (IIRC ~50 or so of them at the time we added the check) so it isn't just something that happens "once", it's ongoing noise being added to the git history. |
I like the sound of this one |
Agreed, @alyssais. I think the editorconfig is really useful for getting everybody's editors essentially configured the same in a lot of fundamental ways. I find this improves collaboration and reduces nitpicks or weirdness like editing a 4-space indented file from someone who didn't know and having your editor start adding 2 space indentations. Editorconfig is a fairly widely adopted standard, GitHub's web editor respects it, and essentially every text editor of significant use has built-in support or plugin. In summary I'm a big fan of educating users on how to configure their editor for editorconfig. It'll improve their experience when contributing to a wide variety of other OSS projects too. |
My problem is that we jumped into enforcing it, without educating the users. IOW, I am not against using editorconfig, but only when things are enforced prematurely. I've opened #121063 that improves that, but I don't think it's where it should be, but I don't have much time to spend on this further. I still think enforcement does more harm than it brings the benefits, but I hope I've shown my willingness to improve that. |
Maybe we can add a paragraph to https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md suggesting people enable editorconfig support in their editors? |
Yes, since nixpkgs-fmt only applies to .nix files. Nixpkgs isn't just .nix files, but also a whole bunch of scripts and other bits and bobs (maybe we could disable the editorconfig job for |
We could also provide a suggested pre-commit-hook for nixpkgs. This might honestly be the best way to approach this:
|
I agree, but I'd like to suggest reducing the scope to get us started. We can work on improving the developer experience once we have the formatting in place. |
editorconfig enforcement is not counterproductive |
Continuing discussion from #120959
I'd like to ask in that case, why enforce it then? If it's automatically handled, there's no need to enforce it. If it's not automatically handled, then we're wasting time from people wanting to contribute.
The text was updated successfully, but these errors were encountered: