Hey! I'm following the docs <here> and using the f...
# general
a
Hey! I'm following the docs here and using the following command derived from examples in there:
Copy code
pants \
  --changed-since=origin/main \
  fmt
However, it gives me different results than
Copy code
pants fmt ::
Meaning, the same files are formatted differently (namely that refers to
isort
) is this expected behaviour ?
1
just running
isort
on its own does the same as running (in terms of imports only)
Copy code
pants fmt ::
h
This is a well-known limitation of Pants+isort: isort attempts to classify which top-level packages are first-party vs third-party by looking at the first-party sources (it assumes it has a full view of them). However, Pants by design only exposes to isort the files it actually needs to operate on. In this case, just the files that have changed.
a
ah, I see, makes sense, thank you
h
The workaround is to configure the known_first_party packages explicitly in isort.cfg/pyproject.toml
a
That worked, thank you!
🎉 1