conventional-changelog/commitlint

Using Periods With Start Case In Subject Fails

Open

#3294 opened on Aug 8, 2022

View on GitHub
 (4 comments) (0 reactions) (0 assignees)TypeScript (15,497 stars) (896 forks)batch import
bughelp wanted

Description

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

Contributor guide