Skip to content

isort behavior depends on which files are available in the sandbox #15069

@kaos

Description

@kaos

Describe the bug

When running isort on a single source file, the result is not always consistent compared to when running on all sources.

Pants version
2.11.0rc1, 2.12.0.dev1

OS
Mac

Additional info

Test case demonstrating this issue in #15002

It seems there are cases even in fmt that requires transitive deps to be present, not only for check.
See related comment: #14186 (comment)

I've run across this a couple of times now at work, where I have a pre-commit hook that runs on a subset of files (exactly the subset of changed files only), and fails, where as when I run by hand I usually use globs like a hammer and includes a whole lot more, which exposes this issue, due to isort not being stable for the two ways it is being invoked.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions