Currently, the EntitySchema extension uses Husky to install a pre-commit hook that runs lint-staged. However, due to the way Husky works, this also disables the commit-msg hook that is used to generate the Change-Id for Gerrit. We should reconsider if this is worth it, and if we want to keep using Husky or not.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Remove husky, document alternative | mediawiki/extensions/EntitySchema | master | +5 -881 |
Related Objects
- Mentioned In
- T332583: Chore: Update dependencies in EntitySchema
Event Timeline
We currently use Husky v1, which installs itself by generating a script for every possible Git hook in .git/hooks/, silently overwriting any already existing hook there. The latest version is v8, which works differently: it changes the core.hooksPath Git config to point to .husky (see this blog post for details), which turns the hook in .git/hooks/commit-msg into dead code.
IMHO, we should just get rid of Husky. We can instead add something like this to the README developer instructions:
Optionally, run the following command to fix JS linting errors automatically before committing:
ln -s ../../node_modules/.bin/lint-staged .git/hooks/pre-commit
Change 902117 had a related patch set uploaded (by Hoo man; author: Hoo man):
[mediawiki/extensions/EntitySchema@master] Remove husky, document alternative
Change 902117 merged by jenkins-bot:
[mediawiki/extensions/EntitySchema@master] Remove husky, document alternative