summaryrefslogtreecommitdiff
path: root/.pre-commit-config.yaml
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2019-08-01 10:44:08 -0400
committerStephen Finucane <stephenfin@redhat.com>2019-12-12 14:56:39 +0000
commite7cc5efd20dc49a24e6bec36f2d9ea9e9ab28128 (patch)
tree4c23a7cff60001f63a908250e58b1f4006bb4b47 /.pre-commit-config.yaml
parent2e7a0088c27ca2b6418a4f9109bb8a6a001602ce (diff)
downloadnova-e7cc5efd20dc49a24e6bec36f2d9ea9e9ab28128.tar.gz
Keep pre-commit inline with hacking and fix whitespace
The flake8 hook for pre-commit installs its own flake8 which is not what hacking is pinned to. This results in a bunch of errors. By doing a local hook we can cause these to be the same. There are flake8 exclusions in tox.ini that need to be used in pre-commit. Also we should exclude svg files from the whitespace modifications, because who cares. Once those are fixed, running pre-commit -a fixes some whitespace issues. While the normal use isn't to run -a - if someone does make a patch that touches any of these they'll get erroneous unrelated errors compared to their lower work - so fix all of the existing issues, which are mostly space-at-end-of-line issues it seems. Change-Id: I78e753492e99c03b30a0a691db3bd75ee3d289c9
Diffstat (limited to '.pre-commit-config.yaml')
-rw-r--r--.pre-commit-config.yaml17
1 files changed, 14 insertions, 3 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 8b64ef712f..33f8df5e33 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -6,16 +6,27 @@ repos:
- id: trailing-whitespace
- id: mixed-line-ending
args: ['--fix', 'lf']
+ exclude: '.*\.(svg)$'
- 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
+ # nova/cmd/manage.py imports pdb on purpose.
+ exclude: 'nova/cmd/manage.py'
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.7
hooks:
- id: remove-tabs
+ exclude: '.*\.(svg)$'
+ - repo: local
+ hooks:
+ - id: flake8
+ name: flake8
+ additional_dependencies:
+ - hacking>=1.1.0,<1.2.0
+ language: python
+ entry: flake8
+ files: '^.*\.py$'
+ exclude: '^(doc|releasenotes|tools)/.*$'