Skip to content

Is it possible to specify the name of the sub pre-commit config files? #2

@mourad1081

Description

@mourad1081

Hello,

I understand that pre-commit will cd at the root of the repo before executing the pre-commit config. When executing from a subfolder, it will create issues because it takes the subfolder pre-commit and then executes it at the root level.

To avoid this issue, is it possible for this hook to retrieve the sub-pre-commit by specifying another filename?

For example,

repos:
  - repo: https://github.com/ddanier/sub-pre-commit.git
    rev: v4.2.0
    hooks:
      - id: sub-pre-commit
        ...
        args: ["-p", "my_sub_project", "--pre-commit-filename", ".sub-pre-commit-config.yaml"]

So that when executing pre-commit run -a from the subfolder, it won't detect any ".pre-commit-config.yaml" and will take the main one at the rool level.

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