acceptable-guitar-79854
10/21/2020, 11:14 PM./pants fmt :: --no-pantsd with
# pants.toml
[isort]
config = "build-support/pyproject.toml"
is different from isort --settings-path build-support/pyproject.tomlhundreds-father-404
10/21/2020, 11:30 PMacceptable-guitar-79854
10/21/2020, 11:32 PMacceptable-guitar-79854
10/21/2020, 11:32 PMacceptable-guitar-79854
10/21/2020, 11:32 PMhundreds-father-404
10/22/2020, 12:06 AM--settings-path is a new option! We haven’t wired that up to Pants because we had isort 4 when adding it
Would you be interested in contributing a fix? I can send some instructionsacceptable-guitar-79854
10/22/2020, 12:10 AMacceptable-guitar-79854
10/22/2020, 12:10 AMacceptable-guitar-79854
10/22/2020, 12:10 AMhundreds-father-404
10/22/2020, 12:27 AM--settings-path if isort.config is defined
https://github.com/pantsbuild/pants/blob/bc4a8fb3f07f6145649f02b06a1e5599aa28b36c/src/python/pants/backend/python/lint/bandit/rules.py#L48-L58 is an example of this, but a difference is that Bandit is only ever one config file, whereas this could be multiple files for isort.
Where it gets tricky is that we can’t use this option if you’re on isort 4. I think you can use Requirement.parse(isort.version).specifier to dynamically see if isort 4 might be resolved, e.g. .specifier.contains("4"). There’s a little wonkiness irc though between whether you want .specifier.contains("4") or need something more precise like specifier.contains("4.0.0")acceptable-guitar-79854
10/22/2020, 12:38 AMacceptable-guitar-79854
10/22/2020, 12:38 AM[isort]
config = "build-support/pyproject.toml"
args = "--settings-path=build-support/pyproject.toml"