forked from laurent22/joplin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tools: Remove message "add --no-verify to bypass" when pre-commit fails
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
diff --git a/lib/runner/index.js b/lib/runner/index.js | ||
index 87e3b3957619728e3ed1ca61e2d83df1c49f928f..6d5ab905415da0577341c8f5b67d4806adcf7549 100644 | ||
--- a/lib/runner/index.js | ||
+++ b/lib/runner/index.js | ||
@@ -68,15 +68,19 @@ function run([, scriptPath, hookName = '', HUSKY_GIT_PARAMS], getStdinFn = get_s | ||
return 0; | ||
} | ||
catch (err) { | ||
- const noVerifyMessage = [ | ||
- 'commit-msg', | ||
- 'pre-commit', | ||
- 'pre-rebase', | ||
- 'pre-push' | ||
- ].includes(hookName) | ||
- ? '(add --no-verify to bypass)' | ||
- : '(cannot be bypassed with --no-verify due to Git specs)'; | ||
- console.log(`husky > ${hookName} hook failed ${noVerifyMessage}`); | ||
+ // We do not want to print this "add --no-verify to bypass" message because that's | ||
+ // literally what some developers do instead of trying to fix the errors. | ||
+ | ||
+ // const noVerifyMessage = [ | ||
+ // 'commit-msg', | ||
+ // 'pre-commit', | ||
+ // 'pre-rebase', | ||
+ // 'pre-push' | ||
+ // ].includes(hookName) | ||
+ // ? '(add --no-verify to bypass)' | ||
+ // : '(cannot be bypassed with --no-verify due to Git specs)'; | ||
+ | ||
+ console.log(`husky > ${hookName} hook failed (Please fix the errors listed above and try again)`); | ||
return err.code; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters