Skip to content

AjayKMehta/lefthook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lefthook

This repo contains a collection of reusable lefthook configuration files for various languages and tools.

Usage

In order to use any of the hooks in this repo, please do the following:

  1. Install lefthook.

  2. In the root directory of your git repo, use lefthook install to create a lefthook.yml file.

  3. Edit the file to include the hooks from this repo that you want:

    remotes:
      - git_url: <https://github.com/AjayKMehta/lefthook.git>
          configs:
            - hooks/pre-commit/<hook1>
            - hooks/pre-commit/<hook2>
            - hooks/pre-push/<hook1>

    💡 All the hooks are located in hooks/<hook-type>/<hook>.

  4. Install dependencies for any hooks of interest (see next section for details).

  5. Run lefthook install to install these hooks in your repo. You can use lefthook check-install and lefthook dump to verify everything is installed and configured correctly.

Available Hooks

  • detect-secrets.yml: This requires gitleaks to be installed.

  • test-dotnet.yml:

    • This ensures .NET code builds and all tests run successfully.

    • You can override the default build configuration (Release) by adding this to your repo's lefthook-local.yml:

      templates:
        build_config: <New value>

    👉 Assumes that there is a solution file at repo root.

About

Collection of reusable hooks for Lefthook.

Topics

Resources

Stars

Watchers

Forks

Languages