File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 1
1
# python-code-validator
2
2
Runs black, mypy, pylint, reorder-python-imports and safety
3
3
4
+ ## Validation strategy
5
+
6
+ 1 . Run ` black -S -l $BLACK_LINE_MAXLEN ` version ` 21.7b0 `
7
+ 2 . Run ` mypy ` version ` 0.900 `
8
+ 3 . Run ` pylint ` version ` 2.9.6 ` , failing if ` score < $PYLINT_THRESHOLD `
9
+ 4 . Run ` reorder-python-imports ` version ` 2.6.0 `
10
+ 5 . Run ` safety ` version ` 1.10.3 `
11
+
12
+ ## Default settings
13
+
14
+ - ` BLACK_LINE_MAXLEN = 100 `
15
+ - ` PYLINT_THRESHOLD = 9 `
16
+
4
17
## Configuration
5
18
In your ` .github/workflows/main.yml ` , set environment variable ` PYLINT_THRESHOLD ` to a value between ` 0 ` and ` 10 ` , e.g.:
6
19
@@ -27,12 +40,9 @@ In your local repo, it may be useful to add a `validation.sh` script to allow lo
27
40
28
41
#!/bin/sh -e
29
42
30
- pip install black mypy pylint-fail-under reorder-python-imports safety
43
+ pip install black==21.7b0 mypy==0.900 pylint==2.9.6 pylint -fail-under==0.3.0 reorder-python-imports==2.6.0 safety==1.10.3
31
44
pip install -r requirements.txt
32
45
33
- export PYLINT_THRESHOLD=8
34
- export BLACK_LINE_MAXLEN=100
35
-
36
46
black -S -l $BLACK_LINE_MAXLEN --check .
37
47
find . -name "*.py" -not -path "./.venv/*" | xargs mypy
38
48
find . -name "*.py" -not -path "./.venv/*" | xargs pylint-fail-under --fail_under $PYLINT_THRESHOLD
You can’t perform that action at this time.
0 commit comments