-
Notifications
You must be signed in to change notification settings - Fork 4
/
run_linter.sh
executable file
·91 lines (76 loc) · 1.7 KB
/
run_linter.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
install_dependencies() {
pip install isort==5.13.2
pip install black==24.4.2
pip install flake8-pyproject==1.2.3
pip install mypy==1.10.0
pip install pylint==3.1.0
pip install pydocstringformatter==0.7.3
}
# Parse command line arguments
INSTALL_DEPS=false
RUN_CLIENT=false
RUN_SERVER=false
RUN_CORE=false
for arg in "$@"; do
case $arg in
--install-deps)
INSTALL_DEPS=true
;;
--client)
RUN_CLIENT=true
;;
--server)
RUN_SERVER=true
;;
--core)
RUN_CORE=true
;;
esac
done
# Install dependencies if flag is set
if [ "$INSTALL_DEPS" == true ]; then
install_dependencies
fi
# If none selected, then run all
if [ "$RUN_CLIENT" == false ] && [ "$RUN_SERVER" == false ] && [ "$RUN_CORE" == false ]; then
RUN_CLIENT=true
RUN_SERVER=true
RUN_CORE=true
fi
if [ "$RUN_SERVER" == true ]; then
echo "Running linting and type checking for server..."
cd server/lomas_server
isort .
black .
flake8 --toml-config=../pyproject.toml .
pylint .
pydocstringformatter -w .
cd ..
mypy .
cd ..
fi
if [ "$RUN_CLIENT" == true ]; then
echo "Running linting and type checking for client..."
cd client/lomas_client
isort .
black .
flake8 --toml-config=../pyproject.toml .
pylint .
pydocstringformatter -w .
cd ..
mypy .
cd ..
fi
if [ "$RUN_CORE" == true ]; then
echo "Running linting and type checking for core..."
cd core/lomas_core
isort .
black .
flake8 --toml-config=../pyproject.toml .
pylint .
pydocstringformatter -w .
cd ..
mypy .
cd ..
fi