Skip to content

Commit 7bd1cac

Browse files
committed
feat: add unified lint script for all linters
- Create script/lint that runs markdownlint and yamllint - Update GitHub workflow to use the new script - Update copilot instructions to reference the new script - Simplifies linting process and centralizes linter configuration
1 parent 833e806 commit 7bd1cac

File tree

3 files changed

+39
-7
lines changed

3 files changed

+39
-7
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,5 @@ Note: E2E tests are excluded from pre-commit checks as they are slow and require
152152
ALWAYS run the linting suite before committing any changes:
153153

154154
```bash
155-
markdownlint "**/*.md"
156-
yamllint -c .yamllint-ci.yml .
155+
./script/lint
157156
```

.github/workflows/testing.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@ jobs:
2222
sudo apt-get install -y yamllint
2323
sudo npm install -g markdownlint-cli
2424
25-
- name: Run markdown linting
26-
run: markdownlint "**/*.md"
27-
28-
- name: Run yaml linting
29-
run: yamllint -c .yamllint-ci.yml .
25+
- name: Run linting
26+
run: ./script/lint
3027
test:
3128
runs-on: ubuntu-latest
3229
name: Test

script/lint

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# Unified lint script for running all linters
4+
# Usage: ./script/lint
5+
#
6+
# This script runs all configured linters for the project:
7+
# - markdownlint for Markdown files
8+
# - yamllint for YAML files
9+
10+
set -e
11+
12+
echo "Running all linters..."
13+
14+
# Check if markdownlint is available
15+
if ! command -v markdownlint &> /dev/null; then
16+
echo "Error: markdownlint is not installed. Please install it with:"
17+
echo " npm install -g markdownlint-cli"
18+
exit 1
19+
fi
20+
21+
# Check if yamllint is available
22+
if ! command -v yamllint &> /dev/null; then
23+
echo "Error: yamllint is not installed. Please install it with:"
24+
echo " pip install yamllint"
25+
echo " # or on Ubuntu/Debian:"
26+
echo " sudo apt-get install yamllint"
27+
exit 1
28+
fi
29+
30+
echo "Running markdown linting..."
31+
markdownlint "**/*.md"
32+
33+
echo "Running yaml linting..."
34+
yamllint -c .yamllint-ci.yml .
35+
36+
echo "All linters passed successfully!"

0 commit comments

Comments
 (0)