blob: 5eae10e536d62236285b35b99fc218d5976ec14c [file] [log] [blame]
Andrew Grimberg4ffa55d2019-04-01 12:48:23 -07001[tox]
2minversion = 1.6
Anil Belur09118342023-05-10 09:41:30 +10003envlist = pre-commit
Andrew Grimberg4ffa55d2019-04-01 12:48:23 -07004skipsdist = true
5
Anil Belur09118342023-05-10 09:41:30 +10006[testenv:jenkins-jobs]
Andrew Grimberg4ffa55d2019-04-01 12:48:23 -07007deps =
Jessica Wagantall3a331802024-02-21 09:58:10 -08008 jenkins-job-builder=={env:JJB_VERSION:6.0.0}
Andrew Grimberg4ffa55d2019-04-01 12:48:23 -07009commands =
Anil Belur09118342023-05-10 09:41:30 +100010 jenkins-jobs {posargs:--help}
11
12[testenv:pre-commit-install]
13basepython = python3
14deps = pre-commit
15commands =
16 pre-commit install
17 pre-commit install --hook-type commit-msg
18
19[testenv:pre-commit-uninstall]
20basepython = python3
21deps = pre-commit
22commands =
23 pre-commit uninstall
24 pre-commit uninstall --hook-type commit-msg
25
26[testenv:pre-commit]
27basepython = python3
28deps = pre-commit
29passenv = HOME
30commands =
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.