Git commit message hook in WebStorm not working

Viewed 1297

I am using husky to hook the Git commit messages.

The commit-msg hook works fine when using with git CLI.

success with git cli

But I am failing with my primary IDE - WebStorm.

Here goes the error screenshot.

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

node version

Any idea why I am facing this error? Thanks in advance.

P.S. I am using Ubuntu 20.04 through WSL 2.0. (not sure this can be a clue :))

enter image description here

0 Answers
Related