|
1 | 1 | --- |
2 | 2 | # This workflow will lint the code in the repository using various tools. Most linting tools in LizardByte |
3 | | -# should be included in this workflow; however there are cases where that is not true, such as with eslint. |
| 3 | +# should be included in this workflow; however, there are cases where that is not true, such as with eslint. |
4 | 4 |
|
5 | 5 | name: common lint (called) |
6 | 6 | permissions: |
|
20 | 20 | lint: |
21 | 21 | name: Common Lint |
22 | 22 | runs-on: ubuntu-latest |
| 23 | + env: |
| 24 | + CLANG_FORMAT_VERSION: 20 |
23 | 25 | steps: |
24 | 26 | - name: Checkout |
25 | 27 | uses: actions/checkout@v5 |
|
74 | 76 | run: | |
75 | 77 | # shellcheck disable=SC2102 # this is triggered by the [toolchain] extra |
76 | 78 | python -m pip install --upgrade \ |
77 | | - clang-format \ |
| 79 | + "clang-format==${CLANG_FORMAT_VERSION}.*" \ |
78 | 80 | pip \ |
79 | 81 | setuptools \ |
80 | 82 | wheel \ |
@@ -162,17 +164,18 @@ jobs: |
162 | 164 | echo found_files=${found_files} >> "${GITHUB_OUTPUT}" |
163 | 165 |
|
164 | 166 | - name: C++ - Clang format (diff) |
| 167 | + id: clang_format_diff |
165 | 168 | if: always() && steps.cpp_files.outputs.found_files |
166 | 169 | uses: DoozyX/clang-format-lint-action@v0.20 |
167 | 170 | with: |
168 | 171 | source: ${{ steps.cpp_files.outputs.found_files }} |
169 | | - clangFormatVersion: '20' |
| 172 | + clangFormatVersion: '${{ env.CLANG_FORMAT_VERSION }}' |
170 | 173 | extensions: 'c,cpp,h,hpp,m,mm' |
171 | 174 | style: file |
172 | 175 | inplace: false |
173 | 176 |
|
174 | 177 | - name: C++ - Clang format (simple) |
175 | | - if: always() && steps.cpp_files.outputs.found_files |
| 178 | + if: always() && steps.clang_format_diff.outcome == 'failure' |
176 | 179 | run: | |
177 | 180 | echo "::add-matcher::.github/matchers/clang-format.json" |
178 | 181 | set +e |
|
0 commit comments