Enforce Python coding style? #3661
Replies: 1 comment
-
Forcing entire files (or the whole project) to match a single style all at once will have unintended negative consequences. I've lived through projects that did this kind of reformatting and it made following history miserable. It also skews attribution badly. And, sadly, if you do this in an automated way, you can actually lose information that was (however terrible this was to do in the first place) encoded in the layout. Any conversion would be better done with a person thinking about what's happening. We could adopt a "clean up the style of the unit that is being changed", but I'd want a separate style-adjusting commit from the functionality change commits. |
Beta Was this translation helpful? Give feedback.
-
Would it make sense to start enforcing a uniform coding style for Python, e.g., based on Black?
It would IMO certainly increase code readability, and would also minimize diffs.
Beta Was this translation helpful? Give feedback.
All reactions