Skip to content

unique-labels reports false-positives when multiple documents are present in the repository. #175

@logsincostan

Description

@logsincostan

Thank you for sharing this useful project!

I usually collect thematically related LaTeX documents in a single repository with one .tex file per document. This works perfectly well with the whole hook suite, except for unique-labels:

If I've got, e.g., two documents with an introduction section each, both labelled \label{sec:introduction}, the hook will report it as duplicate and prevent the commit.

I would like to propose adding an optional flag --individual to unique-labels causing the hook to perform the check on each file individually. You could invoke it like this:

    hooks:
      - id: unique-labels
        args:
            [
              "--individual"
            ]

I know, this is not an ideal solution, but it would help cover my use case. See the pull request #176 for an implementation that works as described.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions