summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2019-09-24 10:11:00 +0100
committerStephen Finucane <stephen@that.guru>2019-09-27 10:36:08 +0100
commitec0be310ecb27cf7fc3f7c42acfdbe89d5221306 (patch)
tree0517025307f1acb577a72a99f818b8a6ff08651c
parent3ebfcd4c18beafa8e6086ec25b9ef9e85b7283f0 (diff)
downloadpatchwork-ec0be310ecb27cf7fc3f7c42acfdbe89d5221306.tar
patchwork-ec0be310ecb27cf7fc3f7c42acfdbe89d5221306.tar.gz
Integrate 'pre-commit'
Helps me avoid simple style issues. We explicitly disable newline checks for some files where the "fix" would be harmful (e.g. mboxes and templates). Signed-off-by: Stephen Finucane <stephen@that.guru>
-rw-r--r--.pre-commit-config.yaml20
1 files changed, 20 insertions, 0 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..bea1187
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,20 @@
+repos:
+- repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v2.3.0
+ hooks:
+ - id: check-executables-have-shebangs
+ - id: check-merge-conflict
+ - id: check-yaml
+ - id: end-of-file-fixer
+ exclude: (.*\.mbox)|(.*\.css)|(.*\.json)|(.*\.js)|(.*\.svg)|(.*/mails/.*-subject\.txt)
+ - id: flake8
+ exclude: ^patchwork/migrations
+ - id: trailing-whitespace
+ exclude: (.*\.mbox)|(.*\.svg)
+- repo: https://github.com/Lucas-C/pre-commit-hooks
+ rev: v1.1.7
+ hooks:
+ - id: remove-tabs
+ exclude: (.*\.mbox)|(.*\.svg)|(.*\.sql)|(.*\.conf)
+ - id: remove-crlf
+ exclude: (.*\.mbox)|(.*\.svg)