Implement automated checks
Closes https://git.xfel.eu/gitlab/detectors/pycalibration/issues/36
- Added pre-commit hooks which:
- isort on
.py
and.ipynb
- flake8 on
.py
and.ipynb
- nbstripout
- rstcheck
- check-added-large-files
- check-ast
- check-json
- check-yaml
- check-toml
- end-of-file-fixer
- trailing-whitespace
- check-docstring-first
- check-merge-conflict
- mixed-line-ending
- isort on
- Hooks run as part of the
check
stage in the CI - Fixed some of the issues:
- EoF
- Trailing whitespace
- isort (but only for .py)
I left two files ( Not the best way to check this works, I'll make another branch off of this one and do a PR onto this branch, that way the tests will run correctly and as if this was already merged.correction_base.py
and sqlite_view.py
) with incorrect EoF to check that the pipeline correctly throws an error when that is encountered.
Tried running isort on all the notebooks, but it modified... literally every single notebook. It's possible there are comments/context/additional details next to the imports or conveyed by their location so I'm hesitant to run isort on all the notebooks automatically without checking them.
Edited by Robert Rosca