Skip to content

Support default value in template? #1358

@kamontat

Description

@kamontat

Description

I would love of we could define default value when template variable is not available.

What problem it is solving?

My use-case is I would like to have share config like

commit-msg:
  commands:
    check:msg:
      run: {check:msg:cmd?pnpm} check:msg --edit {1}

then on project config, we could do like

## Use default pnpm command
extends:
  - ../shared/lefthook.yaml
---

## Override command to npm instead
extends:
  - ../shared/lefthook.yaml
templates:
  "check:msg:cmd": npm

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA new lefthook feature description

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions