-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlint.bat
More file actions
100 lines (76 loc) · 2.21 KB
/
lint.bat
File metadata and controls
100 lines (76 loc) · 2.21 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
@echo off
setlocal
REM Comprehensive Linting Script
REM
REM PURPOSE:
REM - Run ALL lint checks when executed (no options or modes)
REM - Output lint failures directly for agent parsing
REM - NO command-line arguments, pretty printing, or colorization
REM - Agents execute this script to identify files needing fixes
set "LINT_ERROR=0"
REM === PYTHON SECTION ===
REM Create python venv if necessary
if not exist ".venv\Scripts\activate.bat" python -m venv .venv
if errorlevel 1 goto abort_python
REM Activate python venv
call .venv\Scripts\activate.bat
if errorlevel 1 goto abort_python
REM Install python tools
pip install -r pip-requirements.txt --quiet --disable-pip-version-check
if errorlevel 1 goto abort_python
REM Run yamllint
yamllint .
if errorlevel 1 set "LINT_ERROR=1"
REM Section error handling
goto npm_section
:abort_python
set "LINT_ERROR=1"
:npm_section
REM === NPM SECTION ===
REM Install npm dependencies
set "PUPPETEER_SKIP_DOWNLOAD=true"
call npm install --silent
if errorlevel 1 goto abort_npm
REM Run cspell
call npx cspell --no-progress --no-color --quiet "**/*.{md,yaml,yml,json,cs,cpp,hpp,h,txt}"
if errorlevel 1 set "LINT_ERROR=1"
REM Run markdownlint-cli2
call npx markdownlint-cli2 "**/*.md"
if errorlevel 1 set "LINT_ERROR=1"
REM Section error handling
goto dotnet_linting_section
:abort_npm
set "LINT_ERROR=1"
:dotnet_linting_section
REM === DOTNET LINTING SECTION ===
REM Restore dotnet tools
dotnet tool restore > nul
if errorlevel 1 goto abort_dotnet_tools
REM Run reqstream lint
dotnet reqstream --lint --requirements requirements.yaml
if errorlevel 1 set "LINT_ERROR=1"
REM Run versionmark lint
dotnet versionmark --lint
if errorlevel 1 set "LINT_ERROR=1"
REM Run reviewmark lint
dotnet reviewmark --lint
if errorlevel 1 set "LINT_ERROR=1"
REM Section error handling
goto dotnet_format_section
:abort_dotnet_tools
set "LINT_ERROR=1"
:dotnet_format_section
REM === DOTNET FORMATTING SECTION ===
REM Restore dotnet packages
dotnet restore > nul
if errorlevel 1 goto abort_dotnet_format
REM Run dotnet format
dotnet format --verify-no-changes --no-restore
if errorlevel 1 set "LINT_ERROR=1"
REM Section error handling
goto end
:abort_dotnet_format
set "LINT_ERROR=1"
:end
REM Report result
exit /b %LINT_ERROR%