question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing support of release commit syntax

See original GitHub issue

Summary

It tends to be a common practice in the industry to have commits for release notes, and release commits, with the following syntax :

  • Release note for vX.Y.Z
  • Release vX.Y.Z

The <action>(<subject>): <message> syntax for commit messages does not permit to emphasize release-related commits, in fact, it hides them, which is bad for the clarity of the commit history.

Expected Behavior

commitlint to support such syntax, via configuration for example.

Current Behavior

commitlint refuses the syntax.

Affected packages

N/A

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
alexgillecommented, Jun 17, 2022

Hello, thanks for the answers. I think that such syntax would deserve to be ignored by default as it is quite common and not a badly-formatted commit message neither. I might open a PR in that direction, let me know if it is not something you want to see. Feel free to close this issue if you don’t agree with this.

1reaction
Zirakcommented, Jun 17, 2022

@alexgille There’s handling for the default output of standard-version.

If you want to ignore other formats, you can specify an ignores option:

// 3032.config.js
const semver = require('semver');

module.exports = {
    extends: ['@commitlint/config-conventional'],
    ignores: [
        (c) => {
            const version = /^Release v(\S+)/.exec(c);
            return version && semver.valid(version[1]);
        },
    ],
};
$ echo 'Release v1.2.3' | npx commitlint --verbose --config ./3032.config.js
⧗   input: Release v1.2.3
✔   found 0 problems, 0 warnings

$ echo 'Release vm.e.h' | npx commitlint --verbose --config ./3032.config.js
⧗   input: Release vm.e.h
✖   subject may not be empty [subject-empty]
✖   type may not be empty [type-empty]
Read more comments on GitHub >

github_iconTop Results From Across the Web

Git: The Curious Case of the Missing Commits - Stack Overflow
I have some commits that have vanished from our RELEASE Branch ... The git log command traverses the commit graph in ways modifiable...
Read more >
Frequently Asked Questions - semantic-release
Yes, every commits that contains [skip release] or [release skip] in their message will be excluded from the commit analysis and won't participate...
Read more >
conventional commit messaging - Conventional Commits
A specification for adding human and machine readable meaning to commit messages.
Read more >
git rebase | Atlassian Git Tutorial
At first glance this can appear as though the commits are permanently gone. Using git reflog these commits can be restored and the...
Read more >
Python Semantic Release - Read the Docs
python3 -m pip install python-semantic-release semantic-release --help ... We rely on commit messages to detect when a version bump is needed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found