Browse code

update pre-commit filter versions

Bas Nijholt authored on 07/08/2020 13:31:33
Showing 1 changed files
... ...
@@ -1,32 +1,33 @@
1 1
 repos:
2 2
 -   repo: https://github.com/pre-commit/pre-commit-hooks
3
-    rev: v2.4.0
3
+    rev: v3.2.0
4 4
     hooks:
5
-    -   id: trailing-whitespace
6
-    -   id: end-of-file-fixer
7
-    -   id: check-docstring-first
8
-    -   id: check-yaml
9
-    -   id: debug-statements
10
-    -   id: check-ast
5
+        -   id: check-docstring-first
6
+        -   id: check-ast
7
+        -   id: check-json
8
+        -   id: check-yaml
9
+        -   id: debug-statements
10
+        -   id: end-of-file-fixer
11
+        -   id: trailing-whitespace
11 12
 -   repo: https://github.com/ambv/black
12 13
     rev: 19.10b0
13 14
     hooks:
14 15
     - id: black
15 16
       language_version: python3.7
16 17
 -   repo: https://github.com/asottile/pyupgrade
17
-    rev: v1.25.2
18
+    rev: v2.7.2
18 19
     hooks:
19 20
     -   id: pyupgrade
20 21
         args: ['--py36-plus']
21 22
 -   repo: https://github.com/asottile/seed-isort-config
22
-    rev: v1.9.3
23
+    rev: v2.2.0
23 24
     hooks:
24 25
     -   id: seed-isort-config
25 26
 -   repo: https://github.com/pre-commit/mirrors-isort
26
-    rev: v4.3.21
27
+    rev: v5.3.2
27 28
     hooks:
28 29
     -   id: isort
29 30
 -   repo: https://gitlab.com/pycqa/flake8
30
-    rev: 3.7.9
31
+    rev: 3.8.3
31 32
     hooks:
32 33
     -   id: flake8
Browse code

use settings from tox.ini in .pre-commit-config.yaml

Bas Nijholt authored on 16/12/2019 19:10:31
Showing 1 changed files
... ...
@@ -18,26 +18,15 @@ repos:
18 18
     hooks:
19 19
     -   id: pyupgrade
20 20
         args: ['--py36-plus']
21
--   repo: https://github.com/pre-commit/mirrors-isort
22
-    rev: v4.3.21
23
-    hooks:
24
-    -   id: isort
25
-        args:
26
-          - --multi-line=3
27
-          - --trailing-comma
28
-          - --force-grid-wrap=0
29
-          - --use-parentheses
30
-          - --line-width=88
31 21
 -   repo: https://github.com/asottile/seed-isort-config
32 22
     rev: v1.9.3
33 23
     hooks:
34 24
     -   id: seed-isort-config
25
+-   repo: https://github.com/pre-commit/mirrors-isort
26
+    rev: v4.3.21
27
+    hooks:
28
+    -   id: isort
35 29
 -   repo: https://gitlab.com/pycqa/flake8
36 30
     rev: 3.7.9
37 31
     hooks:
38 32
     -   id: flake8
39
-        args:
40
-          - --max-line-length=500
41
-          - --ignore=E203,E266,E501,W503
42
-          - --max-complexity=18
43
-          - --select=B,C,E,F,W,T4,B9
Browse code

do the flake8 test last

Bas Nijholt authored on 16/12/2019 09:33:47
Showing 1 changed files
... ...
@@ -8,15 +8,6 @@ repos:
8 8
     -   id: check-yaml
9 9
     -   id: debug-statements
10 10
     -   id: check-ast
11
--   repo: https://gitlab.com/pycqa/flake8
12
-    rev: 3.7.9
13
-    hooks:
14
-    -   id: flake8
15
-        args:
16
-          - --max-line-length=500
17
-          - --ignore=E203,E266,E501,W503
18
-          - --max-complexity=18
19
-          - --select=B,C,E,F,W,T4,B9
20 11
 -   repo: https://github.com/ambv/black
21 12
     rev: 19.10b0
22 13
     hooks:
... ...
@@ -41,3 +32,12 @@ repos:
41 32
     rev: v1.9.3
42 33
     hooks:
43 34
     -   id: seed-isort-config
35
+-   repo: https://gitlab.com/pycqa/flake8
36
+    rev: 3.7.9
37
+    hooks:
38
+    -   id: flake8
39
+        args:
40
+          - --max-line-length=500
41
+          - --ignore=E203,E266,E501,W503
42
+          - --max-complexity=18
43
+          - --select=B,C,E,F,W,T4,B9
Browse code

add more pre-commit checks

A summary of what the hooks do:
* `pyupgrade` - A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
* `end-of-file-fixer` - Makes sure files end in a newline and only a newline.
* `check-docstring-first` - Checks for a common error of placing code before the docstring.
* `check-yaml` - Attempts to load all yaml files to verify syntax.
* `debug-statements` - Check for debugger imports and py37+ breakpoint() calls in python source.
* `check-ast` - Simply check whether files parse as valid python.
* `seed-isort-config` - Statically populate the `known_third_party` `isort` setting because `isort` sucks at figuring out which third party libs are used. (from author of `pre-commit`)

Bas Nijholt authored on 11/12/2019 13:55:31
Showing 1 changed files
... ...
@@ -1,16 +1,43 @@
1 1
 repos:
2
--   repo: https://github.com/ambv/black
3
-    rev: 19.3b0
4
-    hooks:
5
-    - id: black
6
-      language_version: python3.7
7 2
 -   repo: https://github.com/pre-commit/pre-commit-hooks
8
-    rev: v2.1.0
3
+    rev: v2.4.0
9 4
     hooks:
10
-    -   id: end-of-file-fixer
11 5
     -   id: trailing-whitespace
6
+    -   id: end-of-file-fixer
7
+    -   id: check-docstring-first
8
+    -   id: check-yaml
9
+    -   id: debug-statements
10
+    -   id: check-ast
12 11
 -   repo: https://gitlab.com/pycqa/flake8
13
-    rev: 3.7.8
12
+    rev: 3.7.9
14 13
     hooks:
15 14
     -   id: flake8
16
-        args: ['--max-line-length=500', '--ignore=E203,E266,E501,W503', '--max-complexity=18', '--select=B,C,E,F,W,T4,B9']
15
+        args:
16
+          - --max-line-length=500
17
+          - --ignore=E203,E266,E501,W503
18
+          - --max-complexity=18
19
+          - --select=B,C,E,F,W,T4,B9
20
+-   repo: https://github.com/ambv/black
21
+    rev: 19.10b0
22
+    hooks:
23
+    - id: black
24
+      language_version: python3.7
25
+-   repo: https://github.com/asottile/pyupgrade
26
+    rev: v1.25.2
27
+    hooks:
28
+    -   id: pyupgrade
29
+        args: ['--py36-plus']
30
+-   repo: https://github.com/pre-commit/mirrors-isort
31
+    rev: v4.3.21
32
+    hooks:
33
+    -   id: isort
34
+        args:
35
+          - --multi-line=3
36
+          - --trailing-comma
37
+          - --force-grid-wrap=0
38
+          - --use-parentheses
39
+          - --line-width=88
40
+-   repo: https://github.com/asottile/seed-isort-config
41
+    rev: v1.9.3
42
+    hooks:
43
+    -   id: seed-isort-config
Browse code

update patch version of flake8 in pre-commit config

Joseph Weston authored on 21/11/2019 12:24:47
Showing 1 changed files
... ...
@@ -10,7 +10,7 @@ repos:
10 10
     -   id: end-of-file-fixer
11 11
     -   id: trailing-whitespace
12 12
 -   repo: https://gitlab.com/pycqa/flake8
13
-    rev: 3.7.4
13
+    rev: 3.7.8
14 14
     hooks:
15 15
     -   id: flake8
16 16
         args: ['--max-line-length=500', '--ignore=E203,E266,E501,W503', '--max-complexity=18', '--select=B,C,E,F,W,T4,B9']
Browse code

add pre-commit with black, flake8, and whitespace fixers

Bas Nijholt authored on 06/05/2019 20:12:32
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,16 @@
1
+repos:
2
+-   repo: https://github.com/ambv/black
3
+    rev: 19.3b0
4
+    hooks:
5
+    - id: black
6
+      language_version: python3.7
7
+-   repo: https://github.com/pre-commit/pre-commit-hooks
8
+    rev: v2.1.0
9
+    hooks:
10
+    -   id: end-of-file-fixer
11
+    -   id: trailing-whitespace
12
+-   repo: https://gitlab.com/pycqa/flake8
13
+    rev: 3.7.4
14
+    hooks:
15
+    -   id: flake8
16
+        args: ['--max-line-length=500', '--ignore=E203,E266,E501,W503', '--max-complexity=18', '--select=B,C,E,F,W,T4,B9']