conventional-changelog/commitlint

Using Periods With Start Case In Subject Fails

Open

#3294 aperta il 8 ago 2022

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)TypeScript (896 fork)batch import
bughelp wanted

Metriche repository

Star
 (15.497 star)
Metriche merge PR
 (Merge medio 5g 19h) (65 PR mergiate in 30 g)

Descrizione

Expected Behavior

When using the start-case option in the config for subject-case entering a message such as Feat: Add Module 1.0.0 or Fix: Remove Invalid Return Value In Core.js should pass.

Current Behavior

A problem is found in the current version not allowing for messages with periods to be added unless quoted such as Feat: Add Module "1.0.0" or Fix: Remove Invalid Return Value In "Core.js"

Affected packages

  • cli
  • core

Steps to Reproduce (for bugs)

  1. Set the commitlint.config.js as per the below snippet.
  2. In a terminal enter echo Feat: Add Module 1.0.0 | commitlint -V
  3. Observe the following error output:
⧗   input: Feat: Add Module 1.0.0
✖   subject must be start-case [subject-case]
module.exports = {
  extends: ['@commitlint/config-conventional'],
  rules: {
    'body-case': [2, 'always', 'sentence-case'],
    'header-max-length': [2, 'always', 72],
    'subject-case': [2, 'always', 'start-case'],
    'subject-empty': [2, 'never'],
    'subject-full-stop': [2, 'never', '.'],
    'type-case': [2, 'always', 'start-case'],
    'type-empty': [2, 'never'],
    'type-enum': [
      2,
      'always',
      [
        'Feat',
        'Fix'
      ],
    ],
  },
};

Context

I'd like to be able to use start case subject messages and also be able to include semantic versioning without it failing.

Your Environment

Executable Version
commitlint --version 17.0.3
git --version 2.25.1
node --version 16.14.2

Guida contributor