Andrew Grimberg | 4ffa55d | 2019-04-01 12:48:23 -0700 | [diff] [blame] | 1 | [tox] |
| 2 | minversion = 1.6 |
Anil Belur | 0911834 | 2023-05-10 09:41:30 +1000 | [diff] [blame] | 3 | envlist = pre-commit |
Andrew Grimberg | 4ffa55d | 2019-04-01 12:48:23 -0700 | [diff] [blame] | 4 | skipsdist = true |
| 5 | |
Anil Belur | 0911834 | 2023-05-10 09:41:30 +1000 | [diff] [blame] | 6 | [testenv:jenkins-jobs] |
Andrew Grimberg | 4ffa55d | 2019-04-01 12:48:23 -0700 | [diff] [blame] | 7 | deps = |
Anil Belur | 0911834 | 2023-05-10 09:41:30 +1000 | [diff] [blame] | 8 | jenkins-job-builder=={env:JJB_VERSION:5.0.2} |
Andrew Grimberg | 4ffa55d | 2019-04-01 12:48:23 -0700 | [diff] [blame] | 9 | commands = |
Anil Belur | 0911834 | 2023-05-10 09:41:30 +1000 | [diff] [blame] | 10 | jenkins-jobs {posargs:--help} |
| 11 | |
| 12 | [testenv:pre-commit-install] |
| 13 | basepython = python3 |
| 14 | deps = pre-commit |
| 15 | commands = |
| 16 | pre-commit install |
| 17 | pre-commit install --hook-type commit-msg |
| 18 | |
| 19 | [testenv:pre-commit-uninstall] |
| 20 | basepython = python3 |
| 21 | deps = pre-commit |
| 22 | commands = |
| 23 | pre-commit uninstall |
| 24 | pre-commit uninstall --hook-type commit-msg |
| 25 | |
| 26 | [testenv:pre-commit] |
| 27 | basepython = python3 |
| 28 | deps = pre-commit |
| 29 | passenv = HOME |
| 30 | commands = |
| 31 | pre-commit run --all-files --show-diff-on-failure |
| 32 | pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG |
| 33 | # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage. |
| 34 | # Its default arguments --passed and --msg-filename are different from CI recommandations. |
| 35 | # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file. |