Closed jl-wynen closed 1 year ago
Note for future reference, that it would be nicer to run it like this in a shell pre-commit run -a || pre-commit run -a
, because it only runs the 2nd command if the 1st fails. But tox does not seem to support this.
Why not something like
commands =
sh -c 'pre-commit run -a || pre-commit run -a'
Works. I tried something like this before and it gave a syntax error in tox. I don't remember what I did differently.
I also changed the order of checks in .pre-commit-config.yaml
such that formatters run before analysers. This means, e.g., that flake8 does not report on formatting issues that yapf can fix.
I also changed the order of checks in .pre-commit-config.yaml such that formatters run before analysers. This means, e.g., that flake8 does not report on formatting issues that yapf can fix.
Can you make the same change in scipp please? Thanks!
Can you make the same change in scipp please? Thanks!
Yes. I am going to roll this out everywhere.
I cleaned up the commits to avoid clutter. But this setup seems to work. It runs all pre-commit checks. If static analysis fails, it stops the workflow. If files get reformatted, it commits the result. And as before, CI keeps running with the old files and never with the autocommited ones.