Skip to content

[flake8-pyi] Add autofix for docstring-in-stub (PYI021)#14150

Merged
AlexWaygood merged 6 commits intoastral-sh:mainfrom
InSyncWithFoo:PYI021
Nov 7, 2024
Merged

[flake8-pyi] Add autofix for docstring-in-stub (PYI021)#14150
AlexWaygood merged 6 commits intoastral-sh:mainfrom
InSyncWithFoo:PYI021

Conversation

@InSyncWithFoo
Copy link
Contributor

Summary

Resolves #14123.

Test Plan

cargo nextest run and cargo insta test.

@InSyncWithFoo
Copy link
Contributor Author

The fix does not always result in optimal output, but IIRC these kinds of problems are for the formatter to solve.

 class Foo:
-    """Foo"""  # qux
+      # qux

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks!

InSyncWithFoo and others added 3 commits November 7, 2024 11:20
…_rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap

Co-authored-by: Micha Reiser <micha@reiser.io>
…bs.rs

Co-authored-by: Micha Reiser <micha@reiser.io>
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks!

@AlexWaygood AlexWaygood enabled auto-merge (squash) November 7, 2024 11:56
@AlexWaygood AlexWaygood disabled auto-merge November 7, 2024 11:56
@AlexWaygood AlexWaygood changed the title [flake8-pyi] Remove docstring fix (PYI021) [flake8-pyi] Add autofix for docstring-in-stub (PYI021) Nov 7, 2024
@AlexWaygood AlexWaygood enabled auto-merge (squash) November 7, 2024 11:57
@AlexWaygood AlexWaygood added rule Implementing or modifying a lint rule fixes Related to suggested fixes for violations labels Nov 7, 2024
@AlexWaygood AlexWaygood merged commit b8188b2 into astral-sh:main Nov 7, 2024
@InSyncWithFoo InSyncWithFoo deleted the PYI021 branch November 7, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes Related to suggested fixes for violations rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request: Fix to remove docstrings in stubs (PYI021/docstring-in-stub)

3 participants