-
-
Notifications
You must be signed in to change notification settings - Fork 765
Expand file tree
/
Copy pathrunlint.bat
More file actions
27 lines (25 loc) · 932 Bytes
/
runlint.bat
File metadata and controls
27 lines (25 loc) · 932 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
@echo off
rem runlint [<output dir>]
rem Lints and formats all python files
set hereOrig=%~dp0
set here=%hereOrig%
if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1%
set ruffCheckArgs=
set ruffFormatArgs=
if "%1" NEQ "" set ruffCheckArgs=--output-file=%1/PR-lint.xml --output-format=junit
if "%1" NEQ "" set ruffFormatArgs=--diff
call uv run --group lint --directory "%here%" ruff check --fix %ruffCheckArgs%
if ERRORLEVEL 1 exit /b %ERRORLEVEL%
if "%1" NEQ "" (
call uv run --group lint --directory "%here%" ruff format %ruffFormatArgs% > %1/lint-diff.diff
) else (
call uv run --group lint --directory "%here%" ruff format %ruffFormatArgs%
)
if ERRORLEVEL 1 exit /b %ERRORLEVEL%
rem Run pyright for type checking
if "%1" NEQ "" (
call uv run --group lint --directory "%here%" pyright > %1/pyright-output.txt
) else (
call uv run --group lint --directory "%here%" pyright
)
if ERRORLEVEL 1 exit /b %ERRORLEVEL%