Closed Holt59 closed 4 years ago
Presumably we'd set FileMode
with is_pyi=True
as per https://github.com/psf/black/blob/19.10b0/black.py#L411 when the extension is .pyi
as per https://github.com/psf/black/blob/19.10b0/black.py#L631
And here's the example in the black test suite:
https://github.com/psf/black/blob/master/tests/data/stub.pyi
Plus an example where you'd use black --psi
since the extension is not .psi
:
https://github.com/psf/black/blob/master/tests/data/force_pyi.py
@Holt59 are you able to install and test my proposed fix from the branch on pull request #25? Thanks!
@Holt59 are you able to install and test my proposed fix from the branch on pull request #25? Thanks!
This seems to fix it yes, thank you!
Excellent, thank you. Expect the v0.2.1 release on PyPI shortly...
Problem: Black has specific handling for stubs file (
.pyi
) which does not seem to be considered inflake8-black
. This lead to situation where:Solution: Detect that the input file is a
.pyi
and pass the appropriate option toblack
.