bids-validator icon indicating copy to clipboard operation
bids-validator copied to clipboard

How to use git hooks (husky)

Open sappelhoff opened this issue 2 years ago • 0 comments

We have a pre-commit hook in one of the config files in this repo: https://github.com/bids-standard/bids-validator/blob/54046c1e5624af95baa414833f96e2b70d02ca0f/bids-validator/package.json#L81-L84

I would like to use it, but I am a bit confused how to install it.

  • I usually install this package via npm ci (clean-install)
  • However, that only installs the devDependencies in the root package.json, not those of bids-validator/package.json
  • Yet, the hook dependency (husky) is listed under bids-validator/package.json

What would be the correct workflow to "switch on" the pre-commit hooks?

(I am mostly interested in automatically applying the linter with an autofix at each commit)

sappelhoff avatar Jul 21 '22 15:07 sappelhoff