forked from MaciejMacko/ai-economist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
format_and_lint.sh
executable file
·38 lines (31 loc) · 1.12 KB
/
format_and_lint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
ROOT_DIR="ai_economist/"
echo -e "\n\nRunning ISORT to sort imports ..."
isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses --line-width=88 $ROOT_DIR
echo -e "\n\nRunning BLACK to format code ..."
black --line-length 88 $ROOT_DIR
echo -e "\n\nRunning FLAKE8 check to see if there are Python syntax errors ..."
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics $ROOT_DIR
echo -e "\n\nRunning FLAKE8 formatting check ..."
flake8 --ignore=E203,C901,W503,F401 --count --max-complexity=15 --max-line-length=88 --statistics $ROOT_DIR
echo -e "\n\nRunning PYLINT check ..."
pylint --disable \
bad-continuation,\
duplicate-code,\
import-error,\
invalid-name,\
missing-module-docstring,\
missing-function-docstring,\
no-self-use,\
too-few-public-methods,\
too-many-arguments,\
too-many-branches,\
too-many-instance-attributes,\
too-many-lines,\
too-many-locals,\
too-many-nested-blocks,\
too-many-public-methods,\
too-many-statements, \
$ROOT_DIR
echo -e "\nPlease verify that FLAKE8 and PYLINT run successfully (above). If there are any errors, please fix them."
echo -e "\n\nRunning PYTEST ..."
pytest