Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand CheckRegistry.register as function (#2232) #2233

Merged
merged 4 commits into from
Jun 26, 2024

Conversation

jwhitlock
Copy link
Contributor

Allow setting tags and "deploy" flag when using register as a function. Previously, only the decorator overload allowed these. Closes #2232.

Allow setting tags and "deploy" flag when using register as a function.
Previously, only the decorator overload allowed these.
@jwhitlock jwhitlock force-pushed the jwhitlock-checks-register-2232 branch from b1f1450 to 1963a2a Compare June 25, 2024 14:37
@@ -27,3 +27,45 @@

@register() # E: Value of type variable "_C" of function cannot be "Callable[[int], Sequence[CheckMessage]]" [type-var]
def wrong_args(bla: int) -> Sequence[CheckMessage]: ...
- case: test_checks_register_as_function
Copy link
Member

Choose a reason for hiding this comment

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

Thanks! But tests for this feature is not required :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does that mean I should remove the new tests before this PR is accepted?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please :)

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks!

@sobolevn sobolevn merged commit d5cc944 into typeddjango:master Jun 26, 2024
36 checks passed
@jwhitlock jwhitlock deleted the jwhitlock-checks-register-2232 branch June 26, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

CheckRegistry().register() should allow *tags when called as function
2 participants