[flake8-pyi] Preserve inline comment in ellipsis removal (PYI013)#19399
Merged
ntBre merged 6 commits intoastral-sh:mainfrom Jul 29, 2025
Merged
[flake8-pyi] Preserve inline comment in ellipsis removal (PYI013)#19399ntBre merged 6 commits intoastral-sh:mainfrom
flake8-pyi] Preserve inline comment in ellipsis removal (PYI013)#19399ntBre merged 6 commits intoastral-sh:mainfrom
Conversation
ntBre
reviewed
Jul 28, 2025
Contributor
ntBre
left a comment
There was a problem hiding this comment.
Very nice, thank you! And apologies for the delay in reviewing this.
I had a couple of small nits, but the overall fix looks perfect.
crates/ruff_linter/src/rules/flake8_pyi/rules/ellipsis_in_non_empty_class_body.rs
Outdated
Show resolved
Hide resolved
Contributor
|
Contributor
|
Don't worry about the ecosystem changes yet. I think it's relative to |
ntBre
reviewed
Jul 29, 2025
...src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI013_PYI013.pyi.snap
Show resolved
Hide resolved
flake8-pyi] Preserve inline comment in ellipsis removal (PYI013)
dcreager
added a commit
that referenced
this pull request
Aug 1, 2025
* main: (24 commits) Add `Checker::context` method, deduplicate Unicode checks (#19609) [`flake8-pyi`] Preserve inline comment in ellipsis removal (`PYI013`) (#19399) [ty] Add flow diagram for import resolution [ty] Add comments to some core resolver functions [ty] Add missing ticks and use consistent quoting [ty] Reflow some long lines [ty] Unexport helper function [ty] Remove offset from `CompletionTargetTokens::Unknown` [`pyupgrade`] Fix `UP030` to avoid modifying double curly braces in format strings (#19378) [ty] fix a typo (#19621) [ty] synthesize `__replace__` for dataclasses (>=3.13) (#19545) [ty] Discard `Definition`s when normalizing `Signature`s (#19615) [ty] Fix empty spans following a line terminator and unprintable character spans in diagnostics (#19535) Add `LinterContext::settings` to avoid passing separate settings (#19608) Support `.pyi` files in ruff analyze graph (#19611) [ty] Sync vendored typeshed stubs (#19607) [ty] Bump docstring-adder pin (#19606) [`perflint`] Ignore rule if target is `global` or `nonlocal` (`PERF401`) (#19539) Add license classifier back to pyproject.toml (#19599) [ty] Add stub mapping support to signature help (#19570) ...
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
Fixes #19385.
Based on unnecessary-placeholder (PIE790) behavior, ellipsis-in-non-empty-class-body (PYI013) now safely preserve inline comment on ellipsis removal.
Test Plan
A new test class was added:
with the following expected fix: