-
Notifications
You must be signed in to change notification settings - Fork 72
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
Use Black formatting #249
Comments
An alternative is ruff |
Oh thanks, I didn't know that. I have no strong opinion on ruff over black, the main point of this issue is to suggest to use any of the reasonably popular formatters to have a defined formatting. This project is small enough that there probably isn't a noticeable difference between black and ruff, and its just about deciding whether it is a good idea (I really think so) and picking whichever seems more stable (both seem very mature). |
Bump on this: I "switched" most of my projects to ruff thanks to your suggestion @Tagl For the sake of this issue: Note that ruff and black are the "same", in the sense that ruff does black formatting + a lot of other stuff. Using ruff is nice because it also does a lot of static analysis and quick fixes. I can add ruff with a pre-commit hook / open a PR to see how the repo would look like with ruff applied. |
Hi,
This is more of a recommendation that would ease PR / Merging significantly: Namely, use / require the python formatter
black
. See here for its documentation.Basically,
black
defines one very "rigid" code style, i.e. after formatting a file with black, it will almost always look the same, no matter what formatting one starts from. This may at first sound constricting, but if the style is so rigid, no formatting changes can accidentally creep into MRs and only "actual" changes appear in the PR.Usage is quite simple.
pip install black
followed byblack problemtools/
to format all .py files in that folder. So it also is rather simple to update all existing forks etc.The text was updated successfully, but these errors were encountered: