-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformat.cmd
30 lines (23 loc) · 969 Bytes
/
format.cmd
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
@echo off
echo Running yapf on directory...&echo ----------------------------------&echo.
for %%f in (*.py) do (
echo Running yapf on %%f ...
Python -m yapf --in-place --recursive --style="{indent_width: 4}" %%f
Python -m autoflake --in-place --remove-all-unused-imports --remove-unused-variables %%f
echo %%f formatted using yapf&echo.
)
echo ----------------------------------&echo Checking subdirectories...&echo ----------------------------------&echo.
for /d %%d in (*) do (
echo %%d
cd %%d
echo ----------------------------------
echo.
for %%f in (*.py) do (
echo Running yapf on %%f ...
Python -m yapf --in-place --recursive --style="{indent_width: 4}" %%f
Python -m autoflake --in-place --remove-all-unused-imports --remove-unused-variables %%f
echo %%f formatted using yapf&echo.
)
cd ..
)
echo ----------------------------------&echo Finished formatting directory&echo.&echo.