`isort` ignores config files like `pyproject.toml` when explicitly passing files
I noticed that isort ignores config files as soon as any arguments are passed in on the command line.
Is this really the desired behavior? Especially when isort is called on a specific file only it is very counterintuitive that config files like pyproject.toml are ignored, i.e.,
isort <some-folder>/some_file.pywill ignore my toml file at ./pyproject.toml while
isortwill load the configuration from the toml file.
I have noticed this discrepancy while using isort with the pre-commit framework. Depending on how pre-commit is called it might actually call the tools individually on each file, e.g., when called via pre-commit run --from-ref main --to-ref HEAD. In this case isort won't load the configuration.
This is unlike most other linting/quality check tools like flake8, black, or pylint that will still load the configuration files.
And while I can still explicitly pass in the config file via
isort --sp pyproject.toml <some-folder>/some_file.pyit's still quite unintuitive and should at least be documented.
Source: PyCQA/isort