Skip to content

Add 'pyproject' to types_or for ruff checks#158

Open
mxr wants to merge 1 commit intoastral-sh:mainfrom
mxr:patch-1
Open

Add 'pyproject' to types_or for ruff checks#158
mxr wants to merge 1 commit intoastral-sh:mainfrom
mxr:patch-1

Conversation

@mxr
Copy link

@mxr mxr commented Mar 3, 2026

Summary

This allows ruff to check RUF200 and other checks in pyproject.toml

Test Plan

pre-commit try-repo

Copy link

@bn-andrew bn-andrew left a comment

Choose a reason for hiding this comment

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

Nice one, pending that upgrade in identify 👍🏻

@mxr mxr marked this pull request as ready for review March 15, 2026 18:55
@mxr mxr force-pushed the patch-1 branch 2 times, most recently from f004428 to 836250e Compare March 16, 2026 13:46
@mxr mxr requested a review from ntBre March 16, 2026 13:46
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.

Nice, thank you!

@ntBre
Copy link
Contributor

ntBre commented Mar 17, 2026

Hmm, I'm wondering if maybe we should only suggest this in the documentation for now rather than changing the hook itself. The version of pre-commit I have installed from the Arch repos errors out on unknown type tags, so I'm a bit worried that this will break users with older pre-commit/identify installations. uvx pre-commit was fine, on the other hand, but probably only because I hadn't run it before and got a brand-new installation. I guess it's not really clear when we could add this to the hook, though, unless pre-commit bumps its minimum identify version.

I'm curious to get your thoughts (and maybe @MichaReiser's as well).

@mxr
Copy link
Author

mxr commented Mar 17, 2026

Good point. Let me use https://packaging.python.org/en/latest/guides/analyzing-pypi-package-downloads/ to see how long it will take for the vast majority of downloads to be on identify>=2.6.18. The other thing I can think of is that pre-commit could be patched to ignore unknown types but that also requires waiting for adoption. That solution would also has some edge cases (for example if none of the types are known then that would error out anyway)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants