Skip to content

[ruff] Add ctypes.LittleEndianStructure and others alike to existing exception (RUF012) - #27753

Merged
ntBre merged 2 commits into
astral-sh:mainfrom
royb3:ruff012-ctypes-more-exceptions
Aug 14, 2026
Merged

ntBre merged 2 commits into
astral-sh:mainfrom
royb3:ruff012-ctypes-more-exceptions

Conversation

@royb3

@royb3 royb3 commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

#22559 Added an exception to the fields Class Variable not needing an annotation.

I have the same issue as what the fix is supposed to fix for certain variants of ctypes.Structure.

Test Plan

I extended the ruff012.py file with extra base types and then I added the extra base types to the helper.rs function that detected the original case. Then I updated the snapshot, as the output is what I now expect.

@astral-sh-bot
astral-sh-bot Bot requested a review from ntBre August 14, 2026 11:56
@astral-sh-bot

astral-sh-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@royb3

royb3 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

I made some mistakes. I saw some CI mails about it. 😮

@royb3
royb3 force-pushed the ruff012-ctypes-more-exceptions branch from f6cd89c to 5f7869b Compare August 14, 2026 14:03
@ntBre ntBre added the rule Implementing or modifying a lint rule label Aug 14, 2026

@ntBre ntBre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you!

@ntBre ntBre changed the title Add LittleEndianStructure and others alike to existing exception for RUFF012 [ruff] Add ctypes.LittleEndianStructure and others alike to existing exception (RUF012) Aug 14, 2026
@ntBre
ntBre merged commit e986989 into astral-sh:main Aug 14, 2026
48 checks passed
George-Ogden pushed a commit to George-Ogden/ruff that referenced this pull request Aug 16, 2026
…ing exception (`RUF012`) (astral-sh#27753)

## Summary

astral-sh#22559 Added an exception to the _fields_ Class Variable not needing an
annotation.

I have the same issue as what the fix is supposed to fix for certain
variants of ctypes.Structure.

## Test Plan

I extended the ruff012.py file with extra base types and then I added
the extra base types to the helper.rs function that detected the
original case. Then I updated the snapshot, as the output is what I now
expect.
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.

2 participants