Closed amadeuspzs closed 2 years ago
Hi @amadeuspzs - you can put profile=black
in your configuration file (e.g. pyproject.toml - see https://pycqa.github.io/isort/docs/configuration/config_files.html)
but for some reason, for the nbqa-isort module only, this needs to be args: ["--profile=black"]
yeah unfortunately pre-commit
passes the args
first, which isn't how nbQA expects its arguments. I might need to make a breaking change to the api to get this to work, e.g.
nbqa --tool isort --files file.ipynb
rather than
nbqa isort file.ipynb
For now, either args: ["--profile=black"]
or just using a configuration file to specify this option is what I'd suggest as a workaround
closed by #732
The pre-commit example is:
However, black and isort sometimes fight over module import orders. This is resolved by passing
args: ["--profile", "black"]
into the precommit config, but for some reason, for the nbqa-isort module only, this needs to beargs: ["--profile=black"]
I haven't seen this flagged anywhere so might be specific to my setup.
Is this an issue with pre-commit?