File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 11# python-code-validator
22Runs black, mypy, pylint, reorder-python-imports and safety
33
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+
417## Configuration
518In your ` .github/workflows/main.yml ` , set environment variable ` PYLINT_THRESHOLD ` to a value between ` 0 ` and ` 10 ` , e.g.:
619
@@ -27,12 +40,9 @@ In your local repo, it may be useful to add a `validation.sh` script to allow lo
2740
2841 #!/bin/sh -e
2942
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
3144 pip install -r requirements.txt
3245
33- export PYLINT_THRESHOLD=8
34- export BLACK_LINE_MAXLEN=100
35-
3646 black -S -l $BLACK_LINE_MAXLEN --check .
3747 find . -name "*.py" -not -path "./.venv/*" | xargs mypy
3848 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