Skip to content

Implement automated checks

Robert Rosca requested to merge implement-automated-checks into master

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
  • 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 (correction_base.py and sqlite_view.py) with incorrect EoF to check that the pipeline correctly throws an error when that is encountered. 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.

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

Merge request reports