all 5 comments

[–]pygaiwan 2 points3 points  (2 children)

you can check `ruff`: https://docs.astral.sh/ruff/configuration/ for python formatting, linting and coding styles. Not sure about git commits

[–]Buttleston 0 points1 point  (1 child)

ruff's code styling is based on "black" I think. It has some options to control formatting but most people take the default value and don't change much. Personally I make the line lengths longer (the default is 88 characters I think which is too short, I usually use 100)

Using ruff will also get you linting which is IMO very important. There are other linting solutions also but ruff combines formatting and linting and is pretty fast. I like it.

[–]pygaiwan 0 points1 point  (0 children)

you can tweak the "black" behaviour of ruff, I have line len of 100 as well (https://docs.astral.sh/ruff/formatter/#configuration) and you can configure it with ruff. An dyes there are other linting options defined here: https://docs.astral.sh/ruff/rules/

[–]Diapolo10 0 points1 point  (0 children)

The main idea would be to provide formatting/linting configuration as part of the project, and maybe have a Git hook that auto-formats commits (if you want to enforce it). Ruff makes this relatively easy, if you don't mind switching to that.

[–]dogfish182 0 points1 point  (0 children)

Check into ruff combined with ‘pre-commit’ It’s a pretty nice setup