JPeer264 / node-semantic-git-commit-cli

A CLI for semantic git commits
https://www.npmjs.com/package/semantic-git-commit-cli
MIT License
147 stars 11 forks source link

availableRules[ruleName] is not a function #61

Closed MartinMuzatko closed 6 years ago

MartinMuzatko commented 6 years ago

I get this error when putting rules into my .sgcrc and then try a commit:

image

{
    "scope": true,
    "lowercaseTypes": true,
    "rules": {
        "max-char": -1
    }
}
JPeer264 commented 6 years ago

Hey, thanks for using sgc. Have you triedto write maxChar instead of max-char? Since v3.0.0 we changed that.

MartinMuzatko commented 6 years ago

I just debugged the script, yes I need to use maxChar. This worked :) I'll commit a PR for the change in the docs Thanks!

MartinMuzatko commented 6 years ago

Anyways: there should be a proper error handling for this, this is a pretty bad hint at what is wrong :)

I'd propose something like: "The rule defined does not exist, look at the documentation to check valid rules"

JPeer264 commented 6 years ago

that's actually an awesome idea. I hope @aichbauer or me have time soon to implement this.