Skip to content

The file-contents-sorter pre-commit hook doesn't handle comments well #2017

Open
@bmispelon

Description

@bmispelon

I wanted to add a comment for one of the dependencies in requirements/common.txt and noticed that the file-contents-sorter pre-commit hook complained because it tries to sort all lines alphabetically.

I tried ignoring the hook by committing with --no-verify but the change was made automatically in the PR anyway via the pre-commit bot.

It's nice having dependencies sorted alphabetically, but comments should also be supported. Not sure if that's something that can be configured, or if we can switch to a different hook that would support that usecase.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions