Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,19 +314,22 @@ jobs:
components: clippy
- name: run clippy on wasm
run: cargo clippy --manifest-path=crates/wasm/Cargo.toml -- -Dwarnings
- uses: actions/setup-python@v6.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: install ruff
run: python -m pip install ruff==0.11.8

- name: Ensure docs generate no warnings
run: cargo doc
- name: run ruff check
run: ruff check --diff
- name: run ruff format
run: ruff format --check

- name: Install ruff
uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
with:
version: "0.14.9"

- run: ruff check --diff

- run: ruff format --check

Comment on lines +326 to +329
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

ruff check --diff flag behavior documentation

💡 Result:

Summary of documented behavior:

  • --diff prevents writing fixes, prints unified diffs for changed files, and implies --fix-only. It exits with status 0 when there are no diffs. [1]

Related notes / known issue:

  • There is a reported GitHub issue that using --diff can yield exit code 0 (and no output) even when violations exist but no diffs are produced (interaction with exit codes / fix-only behavior). [2]

Sources:

  • Ruff CLI docs (--diff description). [1]
  • GitHub issue discussing --diff exit-code behavior. [2]

🏁 Script executed:

# Examine the workflow file around the flagged lines
cd /root/repo
cat -n .github/workflows/ci.yaml | sed -n '310,345p'

Repository: RustPython/RustPython

Length of output: 1686


🏁 Script executed:

rg "ruff check" .github/workflows/ -A 1 -B 1

Repository: RustPython/RustPython

Length of output: 175


🏁 Script executed:

rg "ruff" .github/workflows/ci.yaml -n

Repository: RustPython/RustPython

Length of output: 257


ruff check --diff only checks fixable violations; add a full lint check to catch all violations.

ruff check --diff implies --fix-only, which means it only reports violations that can be automatically fixed. This will not catch style issues or violations that require manual fixes, allowing existing violations to persist indefinitely in CI. Either remove --diff to perform a full lint check, or add a separate ruff check (without --diff) step to ensure the entire codebase meets all linting rules.

🤖 Prompt for AI Agents
.github/workflows/ci.yaml around lines 326 to 329: the workflow currently runs
"ruff check --diff" which only reports fixable (auto-fixable) violations; update
the CI to run a full lint check by either removing the --diff flag (use "ruff
check") or adding an additional step that runs "ruff check" (without --diff) in
addition to the existing diff check so all lint violations, including
non-fixable ones, fail CI.

- name: install prettier
run: yarn global add prettier && echo "$(yarn global bin)" >>$GITHUB_PATH

- name: check wasm code with prettier
# prettier doesn't handle ignore files very well: https://github.com/prettier/prettier/issues/8506
run: cd wasm && git ls-files -z | xargs -0 prettier --check -u
Expand Down
Loading