Repository navigation
Lint the tests, and fail CI on ruff errors - #2940
Merged
Merged
Conversation
CI runs these checks but ignores their results, so errors built up. Fix them with ruff 0.15.20, the version uv.lock pins: - Reflow the 28 docstring lines over 100 characters in arcade/input/manager.py and arcade/application.py. - Declare the re-export in arcade/cli/__init__.py in __all__. - Sort imports in arcade (15 files) and tests (92 files) with ruff. - Format tests/integration/test_ubo_stress.py and tests/unit/rendering/image_compare.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Remove tests from ruff's lint exclude, and run ruff check and the import order check on tests as well as arcade in make.py. - The formatting and linting steps no longer continue on error, so a PR with ruff errors fails the Code Inspections check. Every step runs even if an earlier one fails, so all problems are reported together. Type checking still doesn't fail the check, since mypy and pyright have existing errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pyglet clone in my checkout made ruff treat pyglet as first party, so the import order fixes grouped pyglet with arcade, and CI (with pyglet installed as a package) reported 14 files as unsorted. Tell ruff pyglet is third party, so the order doesn't depend on the checkout, and sort again. Checked in a clean worktree without the clone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI now lints the tests, and ruff errors fail the "Code Inspections" check.
Why both
Every code quality step in
code_quality.yml(ruff format, ruff check, mypy, pyright) hadcontinue-on-error: true. Their errors showed in the log, but the check always passed. That's how 29 lint errors, 15 files with unsorted imports, and 2 unformatted files got intodevelopment. The latest run's log shows them while reporting success. So linting tests would only have added lines to a log nobody reads.Commit 1: fix the existing errors
Fixed with ruff 0.15.20, the version
uv.lockpins for CI. I had 0.14.9 locally, which treats a few rules differently.arcade/input/manager.pyandarcade/application.py. I reflowed whole paragraphs rather than splitting single lines. Lists and directives are untouched, andArgs:continuations are indented under their entries so Sphinx keeps them with the argument.arcade/cli/__init__.py: the re-export ofrun_arcade_cliis now declared in__all__(F401).arcade(15 files) andtests(92 files).arcade/__init__.pystays excluded, as the config already says.tests/integration/test_ubo_stress.pyandtests/unit/rendering/image_compare.py.The full suite passes (1732), and every arcade subpackage still imports after the reordering.
Commit 2: lint tests, and make ruff blocking
pyproject.toml: removed"tests"fromlint.exclude.make.py:ruff-checkand the import order check now run onarcadeandtests. That'sRUFF_PATHS, which replacesRUFFOPTS_PACKAGE.code_quality.yml:continue-on-error, so ruff errors fail the check.if: ${{ !cancelled() }}instead ofif: success(), so they still run when an earlier step fails, and you see every problem at once.continue-on-error, because they have existing errors. Making them blocking would be a separate, bigger job.Verified
With ruff 0.15.20, running what CI runs:
ruff format --check: 429 files already formatted.arcadeandtests: all checks passed.ruff check arcade tests: all checks passed.This PR's own Code Inspections run is the real test: it should pass with the steps now blocking.
No library behavior changes, so there's no changelog entry.
🤖 Generated with Claude Code