Skip to content

Instantly share code, notes, and snippets.

@potato4d
Last active March 4, 2019 07:09
Show Gist options
  • Save potato4d/eaf3c3f68e18b461b4ddff10200cef75 to your computer and use it in GitHub Desktop.
Save potato4d/eaf3c3f68e18b461b4ddff10200cef75 to your computer and use it in GitHub Desktop.
npmモジュール`pre-commit`を利用してチーム全体で低品質なコードをコミットできないようにする ref: https://qiita.com/potato4d/items/5dfebb9da1c5fe400809
/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$
var Name = "Tom";
console.log(Name);
"pre-commit": [
"test"
]
}
$ git add -A
$ git commit -m "エラーが出るかテスト"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment