Skip to content

lefthook install should recognize lefthook-local.yml without creating lefthook.yml #1489

Description

@ras0q

Description

According to the documentation, lefthook-local.yml can be used without a main configuration file:

The -local config can be used without a main config file.

However, when only lefthook-local.yml exists, lefthook install reports that no config was found and creates a sample lefthook.yml.

Setting LEFTHOOK_CONFIG=lefthook-local.yml is a possible workaround, but lefthook install should recognize the documented local-only configuration natively.

lefthook.yml

none

Commands to reproduce

export LEFTHOOK_VERBOSE=true
  1. Create a repository without lefthook.yml.
  2. Create only lefthook-local.yml:
    pre-commit:
        jobs:
            - name: check
              run: echo check
  3. Run lefthook install
  4. Lefthook creates lefthook.yml and install hooks

Lefthook version

2.1.10

Possible solution

If the project has lefthook-local.yml, lefthook install should install hooks without lefthook.yml

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions