]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
add pre-commit config
authorDavid Lord <davidism@gmail.com>
Thu, 9 Jan 2020 20:02:54 +0000 (12:02 -0800)
committerDavid Lord <davidism@gmail.com>
Fri, 10 Jan 2020 15:54:34 +0000 (07:54 -0800)
.pre-commit-config.yaml [new file with mode: 0644]
setup.cfg

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644 (file)
index 0000000..3a341a8
--- /dev/null
@@ -0,0 +1,21 @@
+repos:
+  - repo: https://github.com/asottile/reorder_python_imports
+    rev: v1.9.0
+    hooks:
+      - id: reorder-python-imports
+        args: ["--application-directories", "src"]
+  - repo: https://github.com/ambv/black
+    rev: 19.10b0
+    hooks:
+      - id: black
+  - repo: https://gitlab.com/pycqa/flake8
+    rev: 3.7.9
+    hooks:
+      - id: flake8
+        additional_dependencies: [flake8-bugbear]
+  - repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v2.4.0
+    hooks:
+      - id: check-byte-order-marker
+      - id: trailing-whitespace
+      - id: end-of-file-fixer
index dd4e62e0aa48d6b380b422dab833bce323a97db4..5ff30eb42ff42bddd46d723b2807c4b965fd62b8 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -18,3 +18,22 @@ source =
     src/jinja2
     .tox/*/lib/python*/site-packages/jinja2
     .tox/*/site-packages/jinja2
+
+[flake8]
+# B = bugbear
+# E = pycodestyle errors
+# F = flake8 pyflakes
+# W = pycodestyle warnings
+# B9 = bugbear opinions
+select = B, E, F, W, B9
+ignore =
+    # slice notation whitespace, invalid
+    E203
+    # line length, handled by bugbear B950
+    E501
+    # bare except, handled by bugbear B001
+    E722
+    # bin op line break, invalid
+    W503
+# up to 88 allowed by bugbear B950
+max-line-length = 80