Fix ruff 0.16 compatibility (pin default rule set + concise output) - #70
Open
dchaudhari7177 wants to merge 1 commit into
Open
Fix ruff 0.16 compatibility (pin default rule set + concise output)#70dchaudhari7177 wants to merge 1 commit into
dchaudhari7177 wants to merge 1 commit into
Conversation
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.
Fixes #69.
Ruff 0.16 broke
test_ruff_ok,test_ruff_error, andtest_ruff_configwith two independent changes:New rules in the default set. Ruff 0.16 promoted
I(isort) andFA(flake8-future-annotations) into its default rule selection. Sinceruff_config()used--extend-selecton top of ruff's defaults, examples suddenly gotI001/FA100that pytest-examples never opted into (import sorting is opt-in viaisort=, and there's no future-annotations option at all).Fix: pin ruff's classic default base (
E4,E7,E9,F) explicitly and use--select, so the enforced rule set no longer drifts with ruff's defaults. Opt-in flags (isort,upgrade,quotes,ruff_select) extend this base exactly as before. This reproduces the pre-0.16 behavior, so the existing test assertions pass unchanged.Default output format changed. Ruff 0.16 made the grouped
fullformat the default, which breaks the^-:(\d+)offset rewriting inruff_checkand the readable one-error-per-line output. Fix: pass--output-format=conciseexplicitly.tests/test_lint.pyand the ruff/isort/upgrade cases intests/test_run_examples.pyare green.Out of scope: a few
test_black_*/test_insert_printcases andtest_update_examples_dir.pyalso fail onmain, but those are due to a newer black/pytest, not ruff — happy to tackle them separately if useful.