Skip to content

git_hook(lazy=True) not checking unstaged changes #2532

@sparrowt

Description

@sparrowt

Passing lazy=True to git_hook causes isort to discover unstaged files, but then AFAICS it still only checks the staged file content.

This fits with my observed behaviour that running the following in my pre-commit hook:

python -c "import sys; from isort.hooks import git_hook; sys.exit(git_hook(strict=True, modify=True, lazy=True))"

does not flag (or fix) isort errors in files that are modified but not staged.

AFAICS this has been broken since it was added but perhaps I've missed something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions