-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake.bat
More file actions
31 lines (23 loc) · 638 Bytes
/
make.bat
File metadata and controls
31 lines (23 loc) · 638 Bytes
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
@echo off
if "%1"=="" goto help
REM This allows us to expand variables at execution
setlocal ENABLEDELAYEDEXPANSION
REM This will set PYFILES as a list of tracked .py files
set PYFILES=
for /F "tokens=* USEBACKQ" %%A in (`git ls-files "*.py" "*.pyi"`) do (
set PYFILES=!PYFILES! %%A
)
goto %1
:reformat
black !PYFILES!
exit /B %ERRORLEVEL%
:stylecheck
black --check !PYFILES!
exit /B %ERRORLEVEL%
:help
echo Usage:
echo make ^<command^>
echo.
echo Commands:
echo reformat Reformat all .py files being tracked by git.
echo stylecheck Check which tracked .py files need reformatting.