Closed bchopson closed 1 year ago
Also add Black and isort to requirements/dev.in?
Otherwise looks ok to me, although I haven't used any of it yet, so my :+1: might not mean much. :)
Also add Black and isort to requirements/dev.in?
For H2R, we use pre-commit, which takes care of installing black in an isolated virtualenv. We can add an example pre-commit config if we want to be all in on pre-commit. Also, isort is more of an editor concern; some IDEs may have their own import sorting function. The goal with including isort config is that isort will do the right thing if it is in use. If we want to enforce import sorting with isort, then we could add isort via pre-commit.
IMO, we should include the pre-commit config. Ditto for including isort. If we are going to go all in with automated formatting, then sorting imports and enforcing black should also be standard IMO.
Although, maybe the enforcement should happen in CI and not necessarily by hijacking and individual dev's workflow?
Happy to dialogue on what direction we should take here. Thanks.
@rsyring Added pre-commit support with black, isort, flake8, and our custom alembic count-heads hook. I disabled pre-commit checks in CI for the cookiecutter (but not the generated project) since formatting is bound to change after the cookiecutter template is filled in.
Some interesting discussion here on black including isort vs usort link: https://news.ycombinator.com/item?id=30130315
Also add black-friendly config for flake8 and isort
Fixes GH-159, Fixes GH-161