Skip to content

[check-merge-conflict] False positive on RST files that use '=======' for header notation #1924

Description

@hugovk

This is a re-post of pre-commit/pre-commit-hooks#100:

Either ignore that conflict pattern in .rst files or are a option to ignore certain file patterns (I don't want to list all the other file options).

This only shows up when in a merge-conflict, the workaround is to uninstall prek/pre-commit, and then re-install afterwards.


For testing, this can be triggered by adding this to an .rst (or any!) file:

Depends
=======

And temporarily adding --assume-in-merge:

      - id: check-merge-conflict
        args: [--assume-in-merge]

One suggestion to fix: only flag when ======= appears after a <<<<<<< and before a >>>>>>> in the same file.

Of course, those could also occur in real life, but it would greatly reduce the likelihood.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions