cylc-flow
cylc-flow copied to clipboard
Add pre commit configuration (take 2)
Supersede #3467
These changes partially address cylc/cylc-admin#64
This is @sgaist's branch rebased onto master, with some superficial style changes reverted in setup.py
for a minimal diff with current master (so I can investigate why pycodestyle is failing on the CI platform on that branch).
Requirements check-list
- [x] I have read
CONTRIBUTING.md
and added my name as a Code Contributor. - [x] Contains logically grouped changes (else tidy your branch by rebase).
- [x] Does not contain off-topic changes (use other PRs for other changes).
- [x] Does not need tests (coding style validation only).
- [x] No change log entry required (invisible to users).
- [x] No documentation update required.
- [ ] Created an issue at cylc-flow conda-forge repository with version changes (if you changed dependencies in
setup.py
, seerecipe/meta.yaml
). - [ ] No dependency changes.
(same pycodestyle problem here ... maybe it is flake8 failing - it runs pycodestyle, but the new flake8 config overrides tox.ini??)
Ah, that must be it. Added the old tox.ini warnings to the new flake8 config, and the tests are passing.
Last commit removes pycodestyle from the Actions workflow, since flake8 runs pycodestyle anyway.
@hjoliver I think this will produce pull requests with a lot more changes than what the OP intended to. Should we tweak the settings a bit to be more lenient and reduce the changes with each PR, or should we use as-is, to slowly improve the code base?
Good question. I modified and staged scheduler.py
to see what pre-commit run
would do. Seems to me all the changes are good ones, but yes it would create confusing PRs for a while.
We could consider merging this, then processing everything with flake8 etc. in one PR (or a few), to reset the bar, then carry on with consistent style from that point on.
(I'm closing this for now as we haven't managed to get it up the priority list, and it's likely to a while yet ... can possibly revisit at a later date).