-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
black and isort incompatibility within stub files #837
Comments
Workaround for now: from tokenize import TokenInfo
from typing import Iterator, List
# needed to bypass https://github.com/python/black/issues/837
def replacetokens(tokens: List[TokenInfo], fullname: str) -> Iterator[TokenInfo]: ...
def apply_job_security(code: str) -> str: ... |
This is probably fixable with a special case in |
This is fully configurable in isort, however, isn't isort correct here according to pep8? In fact, isn't black being self inconsistent, for example black produces this:
Adding the extra line if I remove it. |
This is specifically in stub files (.pyi), which use a different, more compact coding style. |
@JelleZijlstra this makes sense, is this the standard for |
The closest equivalent is the typeshed coding style: https://github.com/python/typeshed/blob/master/CONTRIBUTING.md#stub-file-coding-style. |
@JelleZijlstra thank you! With the additional information, I don't think this is an issue within Black. I'll have a resolution in isort shortly. ~Timothy |
Thank you! |
With version |
I'll close this then as it stands. |
In this case, black wants to put one line, while
isort
enforces two.The text was updated successfully, but these errors were encountered: