forked from ricardochaves/python-lint
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathentrypoint.sh
executable file
·138 lines (100 loc) · 2.52 KB
/
entrypoint.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/sh -l
# Parameters
#
# $1 - python-root-list
# $2 - use-pylint
# $3 - use-pycodestyle
# $4 - use-flake8
# $5 - use-black
# $6 - use-mypy
# $7 - use-isort
# $8 - use-vulture
# $9 - extra-pylint-options
# ${10} - extra-pycodestyle-options
# ${11} - extra-flake8-options
# ${12} - extra-black-options
# ${13} - extra-mypy-options
# ${14} - extra-isort-options
# ${15} - extra-vulture-options
cp flake8.json /github/workflow/flake8.json
cp mypy.json /github/workflow/mypy.json
cp pylint-error.json /github/workflow/pylint-error.json
cp pylint-warning.json /github/workflow/pylint-warning.json
cp vulture.json /github/workflow/vulture.json
echo "::add-matcher::${RUNNER_TEMP}/_github_workflow/flake8.json"
echo "::add-matcher::${RUNNER_TEMP}/_github_workflow/mypy.json"
echo "::add-matcher::${RUNNER_TEMP}/_github_workflow/pylint-error.json"
echo "::add-matcher::${RUNNER_TEMP}/_github_workflow/pylint-warning.json"
echo "::add-matcher::${RUNNER_TEMP}/_github_workflow/vulture.json"
echo "TERM: changing from $TERM -> xterm"
export TERM=xterm
if [ "$2" = true ] ; then
echo Running: pylint $9 $1
pylint --output-format="colorized" $9 $1
exit_code=$?
if [ "$exit_code" = "0" ]; then
echo "Pylint ok"
else
echo "Pylint error"
fi
fi
if [ "$3" = true ] ; then
echo Running: pycodestyle ${10} $1
pycodestyle ${10} $1
exit_code=$?
if [ "$exit_code" = "0" ]; then
echo "pycodestyle ok"
else
echo "pycodestyle error"
fi
fi
if [ "$4" = true ] ; then
echo Running: flake8 ${11} $1
flake8 ${11} $1
exit_code=$?
if [ "$exit_code" = "0" ]; then
echo "Flake8 ok"
else
echo "Flake8 error"
fi
fi
if [ "$5" = true ] ; then
echo Running: black --check ${12} $1
black --check ${12} $1
exit_code=$?
if [ "$exit_code" = "0" ]; then
echo "Black ok"
else
echo "Black error"
fi
fi
if [ "$6" = true ] ; then
echo Running: mypy ${13} $1
mypy ${13} $1
exit_code=$?
if [ "$exit_code" = "0" ]; then
echo "mypy ok"
else
echo "mypy error"
fi
fi
if [ "$7" = true ] ; then
echo Running: isort ${14} $1 -c --diff
isort ${14} $1 -c --diff
exit_code=$?
if [ "$exit_code" = "0" ]; then
echo "isort ok"
else
echo "isort error"
fi
fi
if [ "$8" = true ] ; then
echo Running: vulture ${15} $1
vulture ${15} $1
exit_code=$?
if [ "$exit_code" = "0" ]; then
echo "vulture ok"
else
echo "vulture error"
fi
fi