WebStorm中的Git提交消息钩子不起作用

时间:2020-07-06 09:29:58

标签: git webstorm husky

我正在用沙哑的方式钩住Git提交消息。

与git CLI一起使用时,commit-msg钩子工作正常。

success with git cli

但是我的主IDE-WebStorm失败了。

这里是错误屏幕截图。

error screen

package.json

{
  "name": "backend",
  "version": "1.0.0",
  "private": true,
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  },
  "scripts": {
...

commitlint.config.js

/**
 * A tool to lint commit messages
 * @see https://github.com/marionebl/commitlint
 *
 * We have limited the labels of the commits to:
 *   - ADDED: new features
 *   - CHANGED: changes in existing functionality
 *   - DEPRECATED: soon-to-be removed features
 *   - REMOVED: removed features
 *   - FIXED: any bug fixes
 *   - SECURITY: in case of vulnerabilities
 */
module.exports = {
  rules: {
    "body-leading-blank": [1, "always"],
    "footer-leading-blank": [1, "always"],
    "header-max-length": [1, "always", 72],
    "scope-case": [2, "always", "lower-case"],
    "subject-case": [
      2,
      "never",
      ["sentence-case", "start-case", "pascal-case", "upper-case"],
    ],
    "subject-empty": [2, "never"],
    "subject-full-stop": [2, "never", "."],
    "type-case": [2, "always", "upper-case"],
    "type-empty": [2, "never"],
    "type-enum": [
      2,
      "always",
      ["ADDED", "CHANGED", "DEPRECATED", "REMOVED", "FIXED", "SECURITY"],
    ],
  },
}

节点版本

node version

知道为什么我会遇到此错误吗?预先感谢。

P.S。我正在通过WSL 2.0使用Ubuntu 20.04。 (不确定这可能是一个线索:))

enter image description here

0 个答案:

没有答案