conventional-changelog / conventional-changelog/commitlint

Using Periods With Start Case In Subject Fails

Open
#3,294 4 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
TypeScript
Stars
18.7k
Forks
970
Avg merge
7h 33m
Merged PRs (30d)
49

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
- [x] cli
- [x] 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]
```

commitlint.config.js

```js
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.