allow_so_beginning = False
allow_there_is = False
allow_cliche_phrases = False
-
-[all.GitCommit]
-bears = GitCommitBear
-ignore_length_regex = Signed-off-by,
- Also-by,
- Co-authored-by,
- http://,
- https://
-
-[all.JSON]
-bears = JSONFormatBear
-files = **.json
-ignore = .**
-indent_size = 2
-
-[all.ShellCheck]
-bears = ShellCheckBear,
- SpaceConsistencyBear
-files = **.sh
-ignore = .git/**,
- .tox/**,
- jjb/global-jjb/**,
- jenkins-config/**,
- jenkins-scripts/*-local-env.sh
-shell = bash
-indent_size = 4
-use_spaces = yeah
-
-[all.YAML]
-bears = YAMLLintBear
-files = jjb/**/*.yaml,openstack-hot/**/*.yaml
-document_start = True
-yamllint_config = yamllint.conf
--- /dev/null
+---
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v2.2.1
+ hooks:
+ - id: check-json
+ - id: flake8
+ args: ['--max-line-length=88']
+ exclude: docs/*
+ - id: trailing-whitespace
+
+ - repo: https://github.com/jorisroovers/gitlint
+ rev: v0.11.0
+ hooks:
+ - id: gitlint
+
+ - repo: https://github.com/jumanjihouse/pre-commit-hooks
+ sha: 1.11.0
+ hooks:
+ - id: shellcheck
+ exclude: >
+ (?x)^(
+ jjb/global-jjb/.*|
+ jenkins-config/.*
+ )$
+
+ - repo: https://github.com/adrienverge/yamllint
+ rev: v1.15.0
+ hooks:
+ - id: yamllint
[tox]
minversion = 1.6
-envlist = coala,docs,jjb-version,pep8,prefix,robot
+envlist = coala,docs,jjb-version,pre-commit,prefix,robot
skipsdist = true
[testenv:coala]
deps =
coala==0.11
coala-bears==0.11
- pygments~=2.3.1
- # Requests 2.16 breaks dependencies
- requests<2.16
- nodeenv==1.1.2
- numpy
+ nodeenv
commands =
nodeenv -p
npm install --global write-good
- python3 -m nltk.downloader punkt maxent_treebank_pos_tagger averaged_perceptron_tagger
coala --non-interactive
[testenv:docs]
[testenv:jjb-version]
commands = python {toxinidir}/check_jjb_version.py
-[testenv:pep8]
-deps = flake8
-commands = flake8 scripts/ *.py
+[testenv:pre-commit]
+basepython = python3
+deps = pre-commit
+commands =
+ pre-commit install --hook-type commit-msg
+ pre-commit run --all-files
[testenv:prefix]
commands = python {toxinidir}/check_prefix.py