ci: Include clang-format version in lint summary

This could help confused developers understand why their clang-format is working differently to CI
This commit is contained in:
Nick Bolton
2025-08-06 11:38:52 +01:00
parent 2a84ef0ebf
commit d7f882f0c4

View File

@ -48,8 +48,10 @@ runs:
run: |
code_block="\`\`\`"
summary=$(cat<<EOF
❌ \`clang-format\`: It looks like your changes don't match our code style.
clang_version=$(clang-format --version | sed -n 's/^.*version //p')
summary=$(cat <<EOF
❌ \`clang-format\` \`v${clang_version}\`: It looks like your changes don't match our code style.
🛠️ Please either run \`clang-format -i\` on the file or apply this patch with \`git apply\`:
@ -57,6 +59,8 @@ runs:
$code_block diff
${{ steps.changes.outputs.diff }}
$code_block
Hint: Install the right version of \`clang-format\`, e.g.: \`pipx install --global clang-format==${clang_version}\`
EOF
)
echo "$summary" >> $GITHUB_STEP_SUMMARY