Repository navigation
fix(python): map ruff syntax errors to parse-error instead of a null smell - #69
Merged
devill merged 1 commit intoJul 1, 2026
Conversation
…smell A file ruff cannot parse is reported with the code invalid-syntax, which the python sensor's map did not know, so it fell through to a null smell and rendered as None instead of being coached. Maps invalid-syntax to parse-error, matching the TS plugin where eslint fatal already maps to parse-error. Adds a spec test, keeps the mirrored command in the crashing-ruff assertion in lockstep, and adds the vocab table row.
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.
The bug
A Python file that ruff cannot parse comes out with a null smell instead of
parse-error. It renders as── None ──, so a broken file is surfaced but mislabelled, not coached as the parse error it is.Root cause
ruff reports syntax errors with the code
invalid-syntax. The python ruff sensor's map only knows the six lint codes it selects, soinvalid-syntaxfalls through the map tonull.The TypeScript plugin already handles this:
eslint:fatalmaps toparse-error(seesmell-vocabulary.md). Python was just missing its twin, and the catalogue already hasparse-error(enforced).The fix
Map
ruff:invalid-syntaxtoparse-errorin the python ruff sensor, so a broken file is coached as a parse error and matches the TS behaviour.Tests
python-plugin.spec.md: a syntax-error file comes out asparse-errorfromruff:invalid-syntax.ruff:invalid-syntaxandparse-errorinsmell-vocabulary.md.The Python suite is green. The Node and PHP sensor specs that fail in CI are pre-existing and unrelated to this change (the workflow installs Python only).