Merge branch 'feat/pre-commit-checks' into 'master'
Feat/pre commit checks - 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 included a lot of other changes and fixes in the original MR (https://git.xfel.eu/gitlab/detectors/pycalibration/merge_requests/411) before figuring out how to get the checks to run only on changed files, which meant that the MR implementing pre-commit checks also refactored a decent chunk of code. It would be better to do that refactoring in separate MRs so I've closed the original one and opened this to replace it. @ahmedk @danilevc @hammerd feel free to review when you have timeTODO: - [x] Add pre-commit to requirements.txt - [x] ~~Don't mutate the code during pre-commit checks~~ - changed my mind about this a few times, left it to mutate the code as that is only done on staged files, so any mutations can be reverted by undoing changes anyway. Added an explanation on this to the readme instead. - [x] Add info to the readme and to the wiki - [x] Add explanation of what each of the checks is for in more detail - [x] Add scripts to execute w/ diff-only (same as the CI pipeline) See merge request detectors/pycalibration!417
No related branches found
No related tags found
Showing
- .git-blame-ignore-revs 7 additions, 0 deletions.git-blame-ignore-revs
- .gitlab-ci.yml 20 additions, 4 deletions.gitlab-ci.yml
- .pre-commit-config.yaml 48 additions, 0 deletions.pre-commit-config.yaml
- README.rst 173 additions, 85 deletionsREADME.rst
- bin/pre-commit-diff.sh 12 additions, 0 deletionsbin/pre-commit-diff.sh
- requirements.txt 6 additions, 5 deletionsrequirements.txt
.git-blame-ignore-revs
0 → 100644
.pre-commit-config.yaml
0 → 100644
bin/pre-commit-diff.sh
0 → 100755
git+file:///gpfs/exfel/sw/calsoft/git/cal_db_interactive@2.0.1 | ||
git+file:///gpfs/exfel/sw/calsoft/git/nbparameterise@0.3 | ||
git+file:///gpfs/exfel/sw/calsoft/git/pyDetLib@2.5.6-2.10.0#subdirectory=lib | ||
Cython == 0.29.21 | ||
Jinja2 == 2.11.2 | ||
astcheck == 0.2.5 | ||
astsearch == 0.1.3 | ||
Cython == 0.29.21 | ||
dill == 0.3.0 | ||
extra_data == 1.2.0 | ||
extra_geom == 1.1.1 | ||
... | ... | @@ -11,22 +12,22 @@ fabio == 0.9.0 |
gitpython == 3.1.0 | ||
h5py == 2.10.0 | ||
iminuit == 1.3.8 | ||
ipyparallel == 6.2.4 | ||
ipykernel == 5.1.4 | ||
ipyparallel == 6.2.4 | ||
ipython == 7.12.0 | ||
ipython_genutils == 0.2.0 | ||
Jinja2 == 2.11.2 | ||
jupyter-core == 4.6.1 | ||
jupyter_client == 6.1.7 | ||
jupyter_console == 6.1.0 | ||
jupyter-core == 4.6.1 | ||
karabo_data == 0.7.0 | ||
lxml == 4.5.0 | ||
metadata_client == 3.0.8 | ||
nbclient == 0.5.1 | ||
nbconvert == 5.6.1 | ||
nbformat == 5.0.7 | ||
notebook == 6.1.5 | ||
notebook == 6.1.5 | ||
numpy == 1.19.1 | ||
pre-commit == 2.10.0 | ||
prettytable == 0.7.2 | ||
princess == 0.2 | ||
pypandoc == 1.4 | ||
... | ... |
Please register or sign in to comment