-
Notifications
You must be signed in to change notification settings - Fork 2k
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
autoformat using black and isort #9955
Conversation
(if yes, can I suggest extending this PR to add autoformat pre-commit hooks and ensure it stays formatted?) |
If my memory is correct, maintainers discussed using black on this project and rejected the proposal at that time. And I also don't prefer it. So -1 for merging this. |
can you be more specific?
I think there's a lot of advantages to auto-formatting in python. For one, once you decide a format style, you never have to talk about formatting again. Also code is easier to grok when it's consistently formatted. I don't have shares in I think the most compelling use for this codebase is the complex, nested |
I know auto-formatting is very worthy in my head. But I can’t have a positive feeling for the format of black very much. So I'd not like to vote for this. Please ask to other maintainers or join maintainers. I won't opposite to merge this if they agreed. Note: This change will make existing pull requests not mergeable. |
This is true. Unless there are any large PRs expected to be merged soon, there's probably no better or worse time to rip the band-aid off. With regard to Black's style- I'm very very strongly in favour of auto-formatting in general, and especially in large open-source projects where consistent formatting is hugely valuable. I'm not married to Black's style in particular (though it happens I do like it). The advantage of black is the lack of configurability. It completely eliminates the need for discussion and debate around formatting. That's maybe a divisive design choice... I'd be happy to consider alternative suggestions for pep8-compliant formatters. |
I'm not against using Black in principle, but in practice I there are problems with a sweeping auto-format.
Is there a strategy to incrementally auto-format the code base over time instead? |
I don't see a way around that, unfortunately. I think it's worth the pain though, to be honest. it also means you won't get merge errors due to formatting changes again going forward.
sweeping formatting changes will always cause problems for open PRs, but we can hold off until specific PRs are merged, if that helps.
note that this PR has both
can you add some inline comments where you see issues? Might be easier to discuss in context
yes. It's absolutely possible to exclude specific files or directories |
Two maintainers have spoken against this PR (right now) -- closing, but we might revisit the issue later. We already use isort. A |
Is this repo autofomatted? should it be?