diff --git a/configuration/extends.html b/configuration/extends.html index 3bd59a4f..05e5252f 100644 --- a/configuration/extends.html +++ b/configuration/extends.html @@ -187,7 +187,7 @@

extends

- @@ -201,7 +201,7 @@

extends

- diff --git a/configuration/index.html b/configuration/index.html index f7e8cf5d..64d4a0a7 100644 --- a/configuration/index.html +++ b/configuration/index.html @@ -175,6 +175,7 @@

Options

  • colors
  • no_tty
  • extends
  • +
  • lefthook
  • min_version
  • output
  • skip_output
  • diff --git a/configuration/lefthook.html b/configuration/lefthook.html new file mode 100644 index 00000000..452872ad --- /dev/null +++ b/configuration/lefthook.html @@ -0,0 +1,257 @@ + + + + + + lefthook - Lefthook Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + + + + +
    +
    +

    lefthook

    +

    Default: null

    +

    Provide a full path to lefthook executable or a command to run lefthook. Bourne shell (sh) syntax is supported.

    +
    +

    Important: This option does not merge from remotes or extends for security reasons. But it gets merged from lefthook local config if specified.

    +
    +

    There are three reasons you may want to specify lefthook:

    +
      +
    1. You want to force using specific lefthook version from your dependencies (e.g. npm package)
    2. +
    3. You use OnP loader for your JS/TS project, and your package.json with lefthook dependency locates in a subfolder
    4. +
    5. You want to make sure you use concrete lefthook executable path and want to defined it in lefthook-local.yml
    6. +
    +

    Examples

    +

    Specify lefthook executable

    +
    # lefthook.yml
    +
    +lefthook: /usr/bin/lefthook
    +
    +pre-commit:
    +  jobs:
    +    - run: yarn lint
    +
    +

    Specify a command to run lefthook

    +
    # lefthook.yml
    +
    +lefthook: |
    +  cd project-with-lefthook
    +  pnpm lefthook
    +
    +pre-commit:
    +  jobs:
    +    - run: yarn lint
    +      root: project-with-lefthook
    +
    +

    Force using a version from Rubygems

    +
    # lefthook.yml
    +
    +lefthook: bundle exec lefthook
    +
    +pre-commit:
    +  jobs:
    +    - run: bundle exec rubocop {staged_files}
    +
    +

    Enable debug logs

    +
    # lefthook-local.yml
    +
    +lefthook: lefthook --verbose
    +
    + +
    + + +
    +
    + + + +
    + + + + + + + + + + + + + + + + + + +
    + + diff --git a/configuration/min_version.html b/configuration/min_version.html index e7025138..5a844bdf 100644 --- a/configuration/min_version.html +++ b/configuration/min_version.html @@ -167,7 +167,7 @@

    min_version - @@ -181,7 +181,7 @@

    min_version