summaryrefslogtreecommitdiff
path: root/.pre-commit-config.yaml
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2019-06-15 16:50:35 +0100
committerStephen Finucane <sfinucan@redhat.com>2019-11-28 12:46:55 +0000
commit5f8dd65f6cfcb7f33e72b9371f325801835c9c83 (patch)
treed2eed315b12c94d0cfaeda41787eaea0f55393dc /.pre-commit-config.yaml
parent23995b4f9945aa242f6a9e7bd5bc700c27f31eb2 (diff)
downloadnova-5f8dd65f6cfcb7f33e72b9371f325801835c9c83.tar.gz
Integrate 'pre-commit'
This nifty tool provides a extensible way to configure pre-commit hooks to do everything from running linters to spellchecking [1] and has already been adopted by a few OpenStack projects [2]. Let's start using it as a faster, more automatic alternative to the 'fast8' tox target and iterate on it as we find more things to use it for. The 'fast8' target is not deprecated though a note is included for end-users to alert them to this great new tool. Note that the 'check-executables-have-shebangs' actually failed and highlighted that the 'contributor/development-environment.rst' document was marked as executable when it shouldn't have been. This is corrected. [1] https://pre-commit.com/ [2] https://review.opendev.org/#/q/file:.pre-commit-config.yaml Change-Id: I256e75eceeb3495dce04885ca42d16adb4160cf3 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to '.pre-commit-config.yaml')
-rw-r--r--.pre-commit-config.yaml21
1 files changed, 21 insertions, 0 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000000..8b64ef712f
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,21 @@
+---
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v2.4.0
+ hooks:
+ - id: trailing-whitespace
+ - id: mixed-line-ending
+ args: ['--fix', 'lf']
+ - id: check-byte-order-marker
+ - id: check-executables-have-shebangs
+ - id: check-merge-conflict
+ - id: debug-statements
+ - id: flake8
+ additional_dependencies:
+ - hacking>=1.1.0,<1.2.0
+ - id: check-yaml
+ files: .*\.(yaml|yml)$
+ - repo: https://github.com/Lucas-C/pre-commit-hooks
+ rev: v1.1.7
+ hooks:
+ - id: remove-tabs