Skip to content

Commit 3bcf191

Browse files
committed
run ruff format with lint
1 parent 50beee4 commit 3bcf191

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

appveyor/scripts/tests/lintCheck.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
$lintOutput = (Resolve-Path .\testOutput\lint\)
2-
$lintOutput = "$lintOutput\PR-lint.xml"
32
.\runlint.bat "$lintOutput"
43
if ($LastExitCode -ne 0) {
54
Set-AppveyorBuildVariable "testFailExitCode" $LastExitCode

runlint.bat

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
@echo off
2-
rem runlint [<output file>]
3-
rem Lints the entire repository
2+
rem runlint [<output dir>]
3+
rem Lints and formats all python files
44
set hereOrig=%~dp0
55
set here=%hereOrig%
66
if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1%
77
set scriptsDir=%here%\venvUtils
88

9-
if "%1" NEQ "" set ruffArgs=--output-file=%1 --output-format=junit
10-
call "%scriptsDir%\venvCmd.bat" ruff check --fix %ruffArgs%
9+
set ruffCheckArgs=
10+
set ruffFormatArgs=
11+
if "%1" NEQ "" set ruffCheckArgs=--output-file=%1/PR-lint.xml --output-format=junit
12+
if "%1" NEQ "" set ruffFormatArgs=--diff > %1/lint-diff.diff
13+
call "%scriptsDir%\venvCmd.bat" ruff check --fix %ruffCheckArgs%
14+
if ERRORLEVEL 1 exit /b %ERRORLEVEL%
15+
call "%scriptsDir%\venvCmd.bat" ruff format %ruffFormatArgs%
1116
if ERRORLEVEL 1 exit /b %ERRORLEVEL%

0 commit comments

Comments
 (0)