Skip to content

Comments

Fix suppression indentation matching#22903

Merged
amyreese merged 3 commits intomainfrom
amy/block-suppression-fix
Jan 29, 2026
Merged

Fix suppression indentation matching#22903
amyreese merged 3 commits intomainfrom
amy/block-suppression-fix

Conversation

@amyreese
Copy link
Member

When loading suppression comments from tokens, fix the token lookback
to look far enough back to find an indent token that isn't matched by
a dedent token. This prevents the system from marking "enable" comments
as having "invalid indentation".

Fix #22869

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 28, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@amyreese amyreese force-pushed the amy/block-suppression-fix branch from 6068ad6 to ae68f90 Compare January 28, 2026 02:28
@amyreese amyreese added suppression Related to supression of violations e.g. noqa bug Something isn't working labels Jan 28, 2026
@amyreese amyreese requested review from dylwil3 and ntBre January 28, 2026 02:28
Copy link
Collaborator

@dylwil3 dylwil3 left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

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

Thank you!

@amyreese amyreese merged commit c85ae85 into main Jan 29, 2026
41 checks passed
@amyreese amyreese deleted the amy/block-suppression-fix branch January 29, 2026 18:07
AlexWaygood pushed a commit that referenced this pull request Jan 29, 2026
When loading suppression comments from tokens, fix the token lookback
to look far enough back to find an indent token that isn't matched by
a dedent token. This prevents the system from marking "enable" comments
as having "invalid indentation".

Fix #22869
carljm added a commit that referenced this pull request Jan 30, 2026
* main: (76 commits)
  [ty] Improve the check for `NewType`s with generic bases (#22961)
  [ty] Ban legacy `TypeVar` bounds or constraints from containing type variables (#22949)
  Bump the typing conformance suite pin (#22960)
  [ty] Emit an error if a TypeVarTuple is used to subscript `Generic` or `Protocol` without being unpacked (#22952)
  [ty] Reduce false positives when subscripting classes generic over `TypeVarTuple`s (#22950)
  [ty] Detect invalid attempts to subclass `Protocol[]` and `Generic[]` simultaneously (#22948)
  Fix suppression indentation matching (#22903)
  Remove hidden `--output-format` warning (#22944)
  [ty] Validate signatures of dataclass `__post_init__` methods (#22730)
  [ty] extend special-cased `numbers` diagnostic to `invalid-argument-type` errors (#22938)
  [ty] Avoid false positive for `not-iterable` with no-positive intersection types (#22089)
  [ty] Preserve pure negation types in descriptor protocol (#22907)
  [ty] add special-case diagnostic for `numbers` module (#22931)
  [ty] Move the location of more `invalid-overload` diagnostics (#22933)
  [ty] Fix unary and comparison operators for TypeVars with union bounds (#22925)
  [ty] Rule Selection: ignore/warn/select all rules (unless subsequently overriden) (#22832)
  [ty] Fix TypedDict construction from existing TypedDict values (#22904)
  [ty] fix bug in string annotations and clean up diagnostics (#22913)
  [ty] Improve support for goto-type, goto-declaration, hover, and highlighting of string annotations (#22878)
  [ty] Rename old typing imports to new on `unresolved-reference`. (#22827)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working suppression Related to supression of violations e.g. noqa

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0.14.14 breaks block suppresion

3 participants