LoginSignup
0
0

More than 3 years have passed since last update.

Atomのgit-controlでPushができないと思ったら、pre-commitでeslintにより弾かれていた件

Last updated at Posted at 2019-12-23

これはTOWN Advent Calendar 2019 23日目のエントリーです。

Atomのgit-controlプラグインを使ってGitの操作をしているのですが、コミットはできるもののプッシュができない(ボタンが選択可能にならない)現象が発生しました。
(よくよく見ると画面の下の方にエラーが出ていたのですが最初気がつかづ。。。)

こういうときには面倒ですがTerminalからコマンドを直接入力して確認をしてみます。

% git commit
husky > pre-commit (node v13.5.0)
  ✔ Stashing changes...
  ❯ Running linters...
    ❯ Running tasks for *.{js,vue}
      ✖ eslint
  ↓ Updating stash... [skipped]
    → Skipping stash update since some tasks exited with errors
  ✔ Restoring local changes...



✖ eslint found some errors. Please fix them and try committing again.

/project/plugins/firestore.js
  1:28  error  Delete `;`  prettier/prettier
  2:42  error  Delete `;`  prettier/prettier
  4:32  error  Delete `;`  prettier/prettier
  7:18  error  Delete `;`  prettier/prettier

✖ 4 problems (4 errors, 0 warnings)
  4 errors and 0 warnings potentially fixable with the `--fix` option.

husky > pre-commit hook failed (add --no-verify to bypass)

どうやらpre-commit時にeslintが効いてコミットが弾かれている、ということがわかります。

該当するファイルを修正して再度コミットすることでPushができるようになりました。

スクリーンショット 2019-12-23 22.57.49.png

git-controlは画面上のウィンドウサイズをを変更できないので長いログが出たときに見落としがちなので注意です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0