|
45 | 45 | sudo apt-get install -y \ |
46 | 46 | make \ |
47 | 47 | build-essential \ |
48 | | - pkg-config |
| 48 | + pkg-config |
49 | 49 | npm install -g markdownlint-cli |
50 | 50 | pip install --user yamllint codespell |
51 | 51 |
|
@@ -81,31 +81,13 @@ jobs: |
81 | 81 | key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} |
82 | 82 |
|
83 | 83 | - name: Install pre-commit |
84 | | - run: pip install pre-commit |
| 84 | + run: make precommit-install |
85 | 85 |
|
86 | 86 | - name: Run Code Spell Check |
87 | 87 | run: make codespell |
88 | 88 |
|
89 | | - - name: Run pre-commit on Go, Rust, JavaScript, Markdown, Yaml and Python files |
90 | | - run: | |
91 | | - # Find all Go, Rust, JavaScripts, Markdown and Python files (excluding vendored/generated code) |
92 | | - FILES=$(find . -type f \( -name "*.go" -o -name "*.rs" -o -name "*.py" -o -name "*.js" -o -name "*.md" -o -name "*.yaml" -o -name "*.yml" \) \ |
93 | | - ! -path "./target/*" \ |
94 | | - ! -path "./candle-binding/target/*" \ |
95 | | - ! -path "./.git/*" \ |
96 | | - ! -path "./node_modules/*" \ |
97 | | - ! -path "./vendor/*" \ |
98 | | - ! -path "./__pycache__/*" \ |
99 | | - ! -path "./site/*" \ |
100 | | - ! -name "*.pb.go" \ |
101 | | - | tr '\n' ' ') |
102 | | - |
103 | | - if [ -n "$FILES" ]; then |
104 | | - echo "Running pre-commit on files: $FILES" |
105 | | - pre-commit run --files $FILES |
106 | | - else |
107 | | - echo "No Go, Rust, JavaScript, Markdown, Yaml, or Python files found to check" |
108 | | - fi |
| 89 | + - name: Run pre-commit check |
| 90 | + run: make precommit-check |
109 | 91 |
|
110 | 92 | - name: Show pre-commit results |
111 | 93 | if: failure() |
|
0 commit comments