Open KrisThielemans opened 11 months ago
eqt
)pre-commit && git commit
" isn't required as (4) https://pre-commit.ci will open a PR authored by the bot anyway
- step (3) "run
pre-commit && git commit
" isn't required as (4) https://pre-commit.ci will open a PR authored by the bot anyway
great. I guess after enabling pre-commit.ci, we create a PR only updates the doc, or maybe it'll run first on master
. that'll be obvious.
I frequently use Black
and MyPy
in .pre-commit-config.yaml
black: Python & extremely opinionated by design (can only config line length) so I don't tend to use it at all
I don't see black being opinionated and strict as a bad thing, it enforces uniformity as default.
It is also worth mentioning MyPy
for static typing. Though, I am not sure it would be useful for STIR as most of the python usages are small script.
98 mostly talks about C++, but we need this for Python as well, which clang-format doesn't do.
Current status for STIR: #724 and #970 installed all/most infrastructure for clang-format, including pre-commit config. We still haven't run this, pending imminent merge of the TOF PR. Current doc on the process is at https://github.com/UCL/STIR/blob/master/documentation/devel/README.md
Some info from @casperdcl
Example file https://github.com/TomographicImaging/eqt/blob/main/.pre-commit-config.yaml.
Note that we run Codacy which runs Bandit, Prospector, Pylint, but this leaves manual intervention by the user, so it's better to do this via pre-commit of course.
Suggested process:
pre-commit
andgit commit --author="pre-commit-format <noreply@github.com>"