Skip to content

isort pre-commit hook does not skip text files #3750

Closed
@mathause

Description

@mathause

MCVE Code Sample

Add arbitrary change to the file doc/pandas.rst

git add doc/pandas.rst
git commit -m "test"

The pre-commit hook will fail.

Expected Output

the pre-commit hook to pass

Problem Description

running isort -rc doc/* will change the following files:

        modified:   contributing.rst
        modified:   howdoi.rst
        modified:   internals.rst
        modified:   io.rst
        modified:   pandas.rst
        modified:   quick-overview.rst

unfortunately it does not behave properly and deletes/ changes arbitrary lines. Can the pre-commit hook be told to only run on *.py files? On the command line this would be isort -rc *.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions