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

Fix black compatibility for .pyi type stub files #2017

Merged
merged 2 commits into from
Dec 10, 2022

Conversation

XuehaiPan
Copy link
Contributor

Ignore lines_after_imports settings for .pyi type stub files if profile black is set. The black formatter does not allow >= 2 line breaks in .pyi type stub files.

Fixes #1976

Copy link
Collaborator

@staticdev staticdev left a comment

Choose a reason for hiding this comment

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

Thanks for the improvement @XuehaiPan, would you mind also adding tests since you added new logic to the code?

@XuehaiPan
Copy link
Contributor Author

@staticdev I update the tests accordingly and they have successfully passed on my local machine.

staticdev
staticdev approved these changes Dec 10, 2022
@staticdev staticdev merged commit fc906c0 into PyCQA:main Dec 10, 2022
@staticdev
Copy link
Collaborator

Thanks @XuehaiPan LGTM.

@XuehaiPan XuehaiPan deleted the black-pyi branch December 10, 2022 12:27
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.

black compatibility: ignore lines_after_imports for .pyi typing stubs
2 participants