Last active
March 4, 2019 07:09
-
-
Save potato4d/eaf3c3f68e18b461b4ddff10200cef75 to your computer and use it in GitHub Desktop.
npmモジュール`pre-commit`を利用してチーム全体で低品質なコードをコミットできないようにする ref: https://qiita.com/potato4d/items/5dfebb9da1c5fe400809
This file contains hidden or 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
/path/to/pre-commit-sample/index.js | |
1:1 error Unexpected var, use let or const instead no-var | |
✖ 1 problem (1 error, 0 warnings) | |
pre-commit: | |
pre-commit: We've failed to pass the specified git pre-commit hooks as the `test` | |
pre-commit: hook returned an exit code (1). If you're feeling adventurous you can | |
pre-commit: skip the git pre-commit hooks by adding the following flags to your commit: | |
pre-commit: | |
pre-commit: git commit -n (or --no-verify) | |
pre-commit: | |
pre-commit: This is ill-advised since the commit is broken. | |
pre-commit: | |
Potato4ds-Macbook:pre-commit-sample potato4d$ |
This file contains hidden or 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
var Name = "Tom"; | |
console.log(Name); |
This file contains hidden or 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
"pre-commit": [ | |
"test" | |
] | |
} |
This file contains hidden or 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
$ git add -A | |
$ git commit -m "エラーが出るかテスト" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment