conventional-changelog/commitlint

Sentence-case is not work properly

Open

#3 517 ouverte le 31 janv. 2023

Voir sur GitHub
 (10 commentaires) (0 réactions) (0 assignés)TypeScript (896 forks)batch import
discussionhelp wanted

Métriques du dépôt

Stars
 (15 497 stars)
Métriques de merge PR
 (Merge moyen 12h 56m) (52 PRs mergées en 30 j)

Description

Expected Behavior

module.exports = {
  extends: ["@commitlint/config-conventional"],
  rules: {
    "subject-case": [2, "always", "sentence-case"],
    "type-enum": [
      2,
      "always",
      ["ADD", "FEAT", "FIX", "REFACTOR", "REMOVE", "TEST", "UPDATE"],
    ],
    "type-case": [2, "always", "upper-case"],
  },
};

I have commitlint.config.js like this. According the rules, my subject sentence should start with capitalized word, other words should be all lowercase.

Current Behavior

But when i try to commit with message like "FEAT: Test Commit", it accepts. It should throw an error because this sentence is not compable with sentence-case.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Steps to Reproduce

1. First step
Add this rule to your configuration: "subject-case": [2, "always", "sentence-case"]
2. Second step
Make a commit that doesn't follow the rule.

commitlint --version

@commitlint/{cli,config-conventional}^17.4.2,

git --version

v2.30

node --version

v16.5.1

Guide contributeur