Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Remote Lefthook Hooks

Remote lefthook hooks repository detailing this issue: evilmartians/lefthook#121 (comment).

See https://github.com/joevin-slq-docto/remote-lefthook-hooks/tree/using-script.

Project Structure

.
├── lefthook.yml   # Remote Hook configuration.
├── mise.toml      # Install requirements on local reposistories.
└── ggshield.sh    # Utility scripts for a hook.

How to use it ?

mkdir testLefthookRun && cd testLefthookRun && git init

Create a lefthook.yml file:

remotes:
  - git_url: https://github.com/joevin-slq-docto/remote-lefthook-hooks
    ref: using-run
mise use lefthook@2.0.3
echo "import 'test';" > test.ts 
git add test.ts
lefthook install
lefthook run pre-commit

Limitation

Using run require to guess the ref (remote-lefthook-hooks-using-run here):

run: |
    export REMOTE_HOOKS_DIR=".git/info/lefthook-remotes/remote-lefthook-hooks-using-run"
    eval "$(mise -C $REMOTE_HOOKS_DIR env)"
    prettier --check {staged_files}

About

Remote configuration for lefthook.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages