mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Fix pr-format CI to fail on formatting changes
Add git diff --exit-code step to fail the check when formatters produce changes. Previously reviewdog only posted suggestions without failing the workflow.
This commit is contained in:
1 parent
61b3b4f42b
commit
bdfe2cf923
1 file changed
+8
@@ -47,7 +47,15 @@ jobs:
|
||||
- name: Run generate_opcode_metadata.py
|
||||
run: python scripts/generate_opcode_metadata.py
|
||||
|
||||
- name: Check for formatting changes
|
||||
run: |
|
||||
if ! git diff --exit-code; then
|
||||
echo "::error::Formatting changes detected. Please run 'cargo fmt --all', 'ruff format', and 'ruff check --select I --fix' locally."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Post formatting suggestions
|
||||
if: failure()
|
||||
uses: reviewdog/action-suggester@v1
|
||||
with:
|
||||
tool_name: auto-format
|
||||
|
||||
Reference in new issue
Block a user