-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlint.sh
More file actions
executable file
·82 lines (62 loc) · 2.01 KB
/
lint.sh
File metadata and controls
executable file
·82 lines (62 loc) · 2.01 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
#!/bin/bash
# Comprehensive Linting Script
#
# PURPOSE:
# - Run ALL lint checks when executed (no options or modes)
# - Output lint failures directly for agent parsing
# - NO command-line arguments, pretty printing, or colorization
# - Agents execute this script to identify files needing fixes
lint_error=0
# === PYTHON SECTION ===
# Create python venv if necessary
if [ ! -d ".venv" ]; then
python -m venv .venv || { lint_error=1; skip_python=1; }
fi
# Activate python venv
if [ "$skip_python" != "1" ]; then
source .venv/bin/activate || { lint_error=1; skip_python=1; }
fi
# Install python tools
if [ "$skip_python" != "1" ]; then
pip install -r pip-requirements.txt --quiet --disable-pip-version-check || { lint_error=1; skip_python=1; }
fi
# Run yamllint
if [ "$skip_python" != "1" ]; then
yamllint . || lint_error=1
fi
# === NPM SECTION ===
# Install npm dependencies
export PUPPETEER_SKIP_DOWNLOAD=true
npm install --silent || { lint_error=1; skip_npm=1; }
# Run cspell
if [ "$skip_npm" != "1" ]; then
npx cspell --no-progress --no-color --quiet "**/*.{md,yaml,yml,json,cs,cpp,hpp,h,txt}" || lint_error=1
fi
# Run markdownlint-cli2
if [ "$skip_npm" != "1" ]; then
npx markdownlint-cli2 "**/*.md" || lint_error=1
fi
# === DOTNET LINTING SECTION ===
# Restore dotnet tools
dotnet tool restore > /dev/null || { lint_error=1; skip_dotnet_tools=1; }
# Run reqstream lint
if [ "$skip_dotnet_tools" != "1" ]; then
dotnet reqstream --lint --requirements requirements.yaml || lint_error=1
fi
# Run versionmark lint
if [ "$skip_dotnet_tools" != "1" ]; then
dotnet versionmark --lint || lint_error=1
fi
# Run reviewmark lint
if [ "$skip_dotnet_tools" != "1" ]; then
dotnet reviewmark --lint || lint_error=1
fi
# === DOTNET FORMATTING SECTION ===
# Restore dotnet packages
dotnet restore > /dev/null || { lint_error=1; skip_dotnet_format=1; }
# Run dotnet format
if [ "$skip_dotnet_format" != "1" ]; then
dotnet format --verify-no-changes --no-restore || lint_error=1
fi
# Report result
exit $lint_error