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
Not compatible with Black #1963
Comments
Hey, would like to point out that the following fixes this for me: #1876 |
Another option, can use the isort skip, off/on action comments, if you prefer black. Or # fmt: off / # fmt: on if you prefer isort. https://pycqa.github.io/isort/docs/configuration/action_comments.html |
You must not be invoking $ cat test.py
from ..builder import (DETECTORS, build_backbone, build_head, build_map_to_bev,
build_neck, build_segmentor, build_voxel_encoder,)
$ pre-commit run --all
isort....................................................................Failed
- hook id: isort
- files were modified by this hook
Fixing /tmp/test/test.py
black....................................................................Passed
$ cat test.py
from ..builder import (
DETECTORS,
build_backbone,
build_head,
build_map_to_bev,
build_neck,
build_segmentor,
build_voxel_encoder,
) as expected. If you’d also like to be able to invoke |
@zheyuanWang should be fixed in 5.11.0, can you check? |
Yes it worked! changing the version of isort solved conflicts.
|
well, same problem reoccured for isort 5.12.0 |
args: ['--profile=black'] alone does not work, you need to use both args: args: ['--profile=black', '--filter-files'] |
@zheyuanWang, what's the problem exactly? The first looks like a line length mismatch, the second (needing both args) is not an incompatibility with black just a specific to how pre-commit works |
sorry, false alarm; 5.12.0 is still compatible with Black. |
According to official link,
I am using the following pre-commit-config:
However, for this file, isort's output is
while Black's output is:
Different output, so the pre-commit check would never pass.
The text was updated successfully, but these errors were encountered: