-
Notifications
You must be signed in to change notification settings - Fork 31
/
checker.bat
76 lines (57 loc) · 1.61 KB
/
checker.bat
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
@echo off
:: Set to the Source.Python packages directory
set SPPACKAGEDIR="%CD%"/addons/source-python/packages/source-python/
:: A place to restart the checking from
:checker
:: Make sure all tools are up-to-date
echo ==========================
echo Installing/Updating tools:
echo ==========================
echo.
pip install --upgrade pep8
pip install --upgrade pep257
pip install --upgrade pyflakes
pip install --upgrade pylint
:: Run checks
echo.
echo.
echo ============================
echo Checking for PEP8 standards:
echo ============================
echo.
python -m pep8 --count --benchmark %SPPACKAGEDIR%
echo.
echo.
echo ==============================
echo Checking for PEP257 standards:
echo ==============================
echo.
python -m pep257 %SPPACKAGEDIR%
echo.
echo.
echo ============================
echo Checking for unused imports:
echo ============================
echo.
python -m pyflakes %SPPACKAGEDIR%
echo.
echo.
echo =====================
echo Checking with PyLint:
echo =====================
echo.
python -m pylint --rcfile "%CD%"/.pylintrc %SPPACKAGEDIR%
GOTO checkagain
:: A place to ask to check again
:checkagain
echo.
echo Check again?
set /p choice=
set result=None
if %choice% == yes set result=True
if %choice% == y set result=True
if %choice% == no set result=False
if %choice% == n set result=False
if %result% == True GOTO checker
if %result% == False exit
if %result% == None GOTO checkagain