Skip to content

Add codemod to fix variadic callable annotations #1269

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

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

yangdanny97
Copy link
Contributor

Summary

Very simple codemod that does one thing, which fixes a somewhat common mistake in type annotations:

Callable[[...], T] -> Callable[..., T]

Test Plan

hatch run python -m unittest libcst.codemod.commands.tests.test_fix_variadic_callable

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 30, 2024
Copy link
Member

@zsol zsol left a comment

Choose a reason for hiding this comment

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

Consider making this a Fixit rule!

@yangdanny97 yangdanny97 merged commit 776452f into Instagram:main Jan 3, 2025
25 checks passed
@yangdanny97 yangdanny97 deleted the callable branch January 3, 2025 00:49
@yangdanny97
Copy link
Contributor Author

Consider making this a Fixit rule!

Instagram/Fixit#501

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants