Skip to content

Conversation

@dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Dec 5, 2024

This PR skips all type definitions (including annotations, quoted annotations, etc.) for the purposes of string-or-bytes-too-long (PYI053).

Closes #12995 (we hope)
Replaces #13020

@dylwil3 dylwil3 added the rule Implementing or modifying a lint rule label Dec 5, 2024
@dylwil3 dylwil3 requested a review from AlexWaygood as a code owner December 5, 2024 21:23
}

if semantic.in_annotation() {
if semantic.in_type_definition() | semantic.in_deferred_type_definition() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

NB: All annotations are type definitions (but not conversely).

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 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.

Thank you!!

@dylwil3 dylwil3 merged commit 1bd8fbb into astral-sh:main Dec 6, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

string-or-bytes-too-long (PYI053) flags and removes long strings in Literal, producing invalid type

2 participants