--- /dev/null
+---
+default_language_version:
+ python: python3
+ node: "14.13.0"
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.2.0
+ hooks:
+ - id: check-json
+ - id: trailing-whitespace
+
+ - repo: https://github.com/pre-commit/mirrors-prettier
+ rev: v2.6.2
+ hooks:
+ - id: prettier
+ stages: [commit]
+
+ - repo: https://github.com/jorisroovers/gitlint
+ rev: v0.17.0
+ hooks:
+ - id: gitlint
+ stages: [commit-msg]
+
+ - repo: https://github.com/jumanjihouse/pre-commit-hooks
+ rev: 2.1.6
+ hooks:
+ - id: shellcheck
+ exclude: >
+ (?x)^(
+ jjb/global-jjb/.*|
+ packer/common-packer/.*|
+ jenkins-config/.*
+ )$
+
+ - repo: https://github.com/adrienverge/yamllint
+ rev: v1.26.3
+ hooks:
+ - id: yamllint
[tox]
minversion = 1.6
-envlist = coala
+envlist = pre-commit
skipsdist = true
-[testenv:coala]
-basepython = python3
+[testenv:jenkins-jobs]
deps =
- coala==0.11
- coala-bears==0.11
- pygments~=2.3.1
- nodeenv~=1.3.0
+ jenkins-job-builder=={env:JJB_VERSION:5.0.2}
+commands =
+ jenkins-jobs {posargs:--help}
+
+[testenv:pre-commit-install]
+basepython = python3
+deps = pre-commit
+commands =
+ pre-commit install
+ pre-commit install --hook-type commit-msg
+
+[testenv:pre-commit-uninstall]
+basepython = python3
+deps = pre-commit
+commands =
+ pre-commit uninstall
+ pre-commit uninstall --hook-type commit-msg
+
+[testenv:pre-commit]
+basepython = python3
+deps = pre-commit
+passenv = HOME
commands =
- nodeenv -p
- npm install --global write-good
- python3 -m nltk.downloader punkt maxent_treebank_pos_tagger averaged_perceptron_tagger
- coala --non-interactive
+ pre-commit run --all-files --show-diff-on-failure
+ pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
+ # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage.
+ # Its default arguments --passed and --msg-filename are different from CI recommandations.
+ # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file.