Hi Pants! We are having a small issue with `./pant...
# general
a
Hi Pants! We are having a small issue with
./pants fmt
. It says that black and isort made changes, however it doesn't really change any files (the command is just
./pants fmt filepath
). Meanwhile if we run
black filepath
actual changes are made.
Commands and outputs:
Copy code
❯ ./pants fmt myfile.py
11:23:01.77 [INFO] Completed: Format with docformatter - Docformatter made no changes.
11:23:01.77 [WARN] Completed: Format with isort - isort made changes.
Fixing myfile.py


11:23:01.77 [WARN] Completed: Format with Black - Black made changes.
reformatted myfile.py
All done! ✨ 🍰 ✨
1 file reformatted.



+ Black made changes.
✓ Docformatter made no changes.
+ isort made changes.

❯ git status
On branch xxx
Your branch is up to date with 'origin/xxx'.

nothing to commit, working tree clean

❯ black myfile.py
reformatted myfile.py
All done! ✨ 🍰 ✨
1 file reformatted.


❯ git status
On branch xxx
Your branch is up to date with 'origin/xxx'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   myfile.py
pants.toml
config:
Copy code
[black]
args = ["--line-length=100"]

[isort]
config = [".isort.cfg"]
This hasn't happened to us before which makes this case interesting.
h
Hello! My first thought would be if isort and black are overwriting each other. Have you configured them to be compatible? If you run them both directly without Pants, does it work as you expect?
a
Have you configured them to be compatible?
they've been compatible so far, but that's likely! When I run black alone it does make changes to the imports.
maybe this is an edge case we just ran into for the first time. I'll check that and report back, thanks Eric!
What is the suggestion to make isort and black compatible? is
profile = "black"
sufficient?
a
yep looks like that's what it takes!
👍 2
🙌 1