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

Custom Rules #29

Closed JPeer264 closed 7 years ago

JPeer264 commented 7 years ago

What you think about custom rules?

By now rules are just enabled or disabled, but what if somebody wants his own rule? I though about following:

{ // .sgcrc
  ...
  "rules": {
    "max-char": 72,
    "custom": [
      {
        "forbidTrailingDot": (input, config) => ({
          message: () => '',
          check: () => {
          }
        })
      }
    ]
  },
  ...
}

Unfortunately this is not possible with JSON. But this feature would still be good, you think it's generally a good idea to have custom rules?

aichbauer commented 7 years ago

I don' think that this is something we should implement. I think that this should be a tool that helps you configuring the commit messages very fast, and not that someone has to write own code before using it. If there is a rule missing we should add this to our tool. Or what do you think?

Can you name some rules that someone wants to implement? Is forbidTrailingDot the same as the end-with-dot rule?

JPeer264 commented 7 years ago

You are right.

Is forbidTrailingDot the same as the end-with-dot rule?

Yes. It was just an example ;)