- Update messages
- Update docs
- Upgrade
is-ci
and support more CIs - Disable
1.3.0
change related tostdin
due to a bug on Windows
- Enable
stdin
if hook is running in a terminal
- Fix don't fail if directory in project contains whitespace
- Add comments to generated hooks to specify which package has installed husky and when
- Upgrade
execa
dependency
- Fix don't fail if
package.json
doesn't exist
- Add debug message
- Check
HUSKY_SKIP_INSTALL
value first before checking if.git
exists - Check Node version before running hooks
- Create
.git/hooks
if it doesn't exist
After a year of pre-releases and a complete rewrite, this marks the first stable release of husky 🐶🎉.
Below you'll find consolidated changes since 0.14.3
. There's no change in code between 1.0.0-rc.15
and 1.0.0
.
-
Hooks
- Add
sendemail-validate
hook
- Add
-
Config
- Move hooks config from
scripts
field tohusky
field - Prefer raw names for hooks (e.g.
pre-commit
rather thanprecommit
) - Support
.huskyrc
config
- Move hooks config from
-
Package managers
-
Environment variables
- Add
HUSKY_SKIP_INSTALL
environment variable for skipping git hooks installation - Add
HUSKY_GIT_STDIN
environment variable forpre-push
,pre-receive
,post-receive
andpost-rewrite
to access arguments passed by Git via stdin - Rename
GIT_PARAMS
toHUSKY_GIT_PARAMS
- Add
-
Messages
- Add many more messages in case of errors
- Add please-upgrade-node message if using with unsupported Node version
- Make
--no-verify
message more accurate and only show it for hooks that can be skipped
-
Upgrade
- Add
husky-upgrade
command to automatically migrate hooks inpackage.json
- Add deprecation warning for hooks that are still defined in
scripts
- Add
-
Other
- Drop
Node 4
support - Drop integrated
nvm
support (see Node version management in docs)
- Drop
Huge thanks to all the Contributors and Patreon Supporters! 🙏
- Update docs
- Make
--no-verify
message more accurate and only show it for hooks that can be skipped - Improve error messages
- Show a message when Node can't be found in PATH
- Fix exit code when used with unsupported Node version
- Update dependencies
- Show a message instead of crashing if Node version is unsupported by Husky
- Fix
HUSKY_GIT_PARAMS
containing only the first Git param
- If
node_modules/husky
is missing, show message but do not crash - Remove and upgrade some
dependencies
- Add
HUSKY_GIT_STDIN
environment variable forpre-push
,pre-receive
,post-receive
andpost-rewrite
to access arguments passed by Git via stdin.
- Update
cosmiconfig
dependency - Fix
package.json
normalization error
- Fix install error with
pnpm
- Auto migrate
yorkie
hooks
- Re-enable Git submodule and worktree support
- Re-enable subdirectory support
- Upgrade
run-node
dependency
- Namespace environment variable created by husky
GIT_PARAMS
becomesHUSKY_GIT_PARAMS
- Starting also with
1.0.0
versioning
- Revert
GIT_STDIN
for the moment. Needs more testing.
rc.10
, rc.11
and rc.12
are broken for some GUI clients due to read
command
- Handle case where
.git/hooks
directory doesn't exit
- Handle case where
v0.14
git hooks wouldn't have been uninstalled
- Move
postinstall
script toinstall
- Fix line ending error when running
upgrader
from OS X/Linux
- Fix
[[
error
- Fix error with GitHub Desktop on Windows
- Catch error if
git
command fails
- Fix
husky-upgrade
- Drop
Node 4
support
- Fix install error
sendemail-validate
hook #173HUSKY_SKIP_INSTALL
environment variable for skipping git hooks installation #178.huskyrc
config #209pnpm
support- Support environments where
yarn
is the only package manager installed - Move config from
scripts
field tohusky
field - Prefer raw names for Git hooks (
pre-commit
rather thanprecommit
) - Drop integrated
nvm
support - To ease upgrade:
- Provide
husky-upgrade
command - Add deprecation warning for hooks that are defined in
scripts
(but still run them)
- Provide
- Fix handle space in
PATH
#150
- Fix handle space in
HOME
- Fix Git hooks install on Windows
- Fix hook script when
nvm
was installed with Brew
- Fix
npm@5
Error: Cannot find module
warning when uninstalling - Drop
Node 0.12
support - Don't reload
nvm
if it's already inPATH
- Add Git worktree support #114
- Hide irrelevant
--no-verify
message forprepare-commit-msg
#137
- Add Node version to husky output
- Revert
Fixes issue with OS X + brew where nvm was loaded even when npm was already present
that was introduced inv0.13.0
as it was preventing Husky to loadnvm
in some cases #106
- Fixes issue #103
- Makes it easier for projects to transition from ghooks by detecting ghooks installed scripts and automatically migrating them
- Makes
husky
a little less verbose by default - Fixes issue with
OS X + brew
wherenvm
was loaded even whennpm
was already present - Fixes issue with Git
v1.9
on Windows - Prevents Git hooks being installed when husky is in a sub
node_modules
directory (i.e../node_modules/A/node_modules/husky
)
- Adds Git submodule support
- Adds Cygwin support
- Improves edge cases support (
.git
not found andgit
not inPATH
) - If
npm
is already present in path, doesn't loadnvm
default or.nvmrc
version, which makes things faster in terminal. In GUI apps, the behavior is unchanged.