Bump Ruff to 0.12.9, update output parsing for new rendering#68
Bump Ruff to 0.12.9, update output parsing for new rendering#68hramezani wants to merge 1 commit into
Conversation
Ruff 0.12.9 (astral-sh/ruff#19966) split the diagnostic header so the location renders on a separate `--> file:line:col` line, indented to align with the source gutter. Update the offset-rewriting regex to match the new format and preserve the variable-width indentation (so the path substitution still works when the error is on a multi-digit line number), and bump the minimum Ruff to 0.12.9. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
I'm also happy to rebase #65. I wasn't aware that that was the blocker to moving forward with the PR. |
would be great if you could rebase your PR. Please consider the fix that I did for multi-digit line number and include the test |
|
Actually, I'll just close mine in favor of this given your additional improvements. Thanks for picking it up! |
Sorry @ntBre. I created the new PR because I didn't want to bother you after a long time for the rebase and review! |
|
No worries at all, I'm very happy to leave it in your hands! Let me know if you end up needing anything from me :) |
Ruff 0.12.9 changed the
fulloutput rendering (astral-sh/ruff#19966): the diagnostic header is split so the location is emitted on a separate--> file:line:colline instead of the oldfile:line:col: CODE messagesingle line. This brokeruff_check's offset rewriting and the associated tests.This bumps the minimum Ruff to
>=0.12.9and updates the parsing to the new format.Relationship to #65
This builds directly on @ntBre's work in #65 — same root cause and same fix approach. I opened a fresh PR for two reasons:
main(after Add support for Python 3.14, drop EOL 3.8-3.9 #67 dropped EOL 3.8/3.9 and touched the samerequires-pythonline). This branch is cut from currentmain, so it merges cleanly.Happy to fold these changes into #65 instead if that's preferable — I just wanted to get a mergeable, rebased version up.
Multi-digit line numbers
Ruff indents the
-->arrow to align with the source gutter, so the leading whitespace widens once the line number reaches two digits:To keep the offset substitution working regardless of line-number width, this matches variable leading whitespace (
r'^( *)--> -:(\d+)') and preserves it in the replacement. It also addstest_ruff_offset_multiline, which puts the error on line 10 (and again withstart_line=10) so this stays covered.All existing tests pass, plus
ruff format --check,ruff check, andpyrightare clean.