Skip to content

Commit e481976

Browse files
Merge pull request #59 from conventional-changelog/master
[pull] master from conventional-changelog:master
2 parents cdbcaf0 + daec60f commit e481976

31 files changed

+1067
-848
lines changed

@alias/commitlint/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [19.4.0](https://github.com/conventional-changelog/commitlint/compare/v19.3.1...v19.4.0) (2024-08-07)
7+
8+
**Note:** Version bump only for package commitlint
9+
10+
11+
12+
13+
614
# [19.3.0](https://github.com/conventional-changelog/commitlint/compare/v19.2.2...v19.3.0) (2024-04-23)
715

816
**Note:** Version bump only for package commitlint

@alias/commitlint/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "commitlint",
33
"type": "module",
4-
"version": "19.3.0",
4+
"version": "19.4.0",
55
"description": "Lint your commit messages",
66
"files": [
77
"cli.js"
@@ -36,7 +36,7 @@
3636
},
3737
"license": "MIT",
3838
"dependencies": {
39-
"@commitlint/cli": "^19.3.0",
39+
"@commitlint/cli": "^19.4.0",
4040
"@commitlint/types": "^19.0.3"
4141
},
4242
"devDependencies": {

@commitlint/cli/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [19.4.0](https://github.com/conventional-changelog/commitlint/compare/v19.3.1...v19.4.0) (2024-08-07)
7+
8+
9+
### Features
10+
11+
* support command line options from a file ([#4109](https://github.com/conventional-changelog/commitlint/issues/4109)) ([a20e890](https://github.com/conventional-changelog/commitlint/commit/a20e890f6b6c8bacdc511d40cb41f29415bdd044))
12+
* support linting from the last tag ([#4110](https://github.com/conventional-changelog/commitlint/issues/4110)) ([4b204ec](https://github.com/conventional-changelog/commitlint/commit/4b204ecfb43dd6a00e24b51111aadbd78f9d58e1))
13+
14+
15+
16+
17+
618
# [19.3.0](https://github.com/conventional-changelog/commitlint/compare/v19.2.2...v19.3.0) (2024-04-23)
719

820
**Note:** Version bump only for package @commitlint/cli

@commitlint/cli/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@commitlint/cli",
33
"type": "module",
4-
"version": "19.3.0",
4+
"version": "19.4.0",
55
"description": "Lint your commit messages",
66
"files": [
77
"index.cjs",
@@ -50,8 +50,8 @@
5050
"dependencies": {
5151
"@commitlint/format": "^19.3.0",
5252
"@commitlint/lint": "^19.2.2",
53-
"@commitlint/load": "^19.2.0",
54-
"@commitlint/read": "^19.2.1",
53+
"@commitlint/load": "^19.4.0",
54+
"@commitlint/read": "^19.4.0",
5555
"@commitlint/types": "^19.0.3",
5656
"execa": "^8.0.1",
5757
"yargs": "^17.0.0"

@commitlint/cli/src/cli.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ test('should print help', async () => {
548548
-x, --extends array of shareable configurations to extend [array]
549549
-H, --help-url help url in error message [string]
550550
-f, --from lower end of the commit range to lint; applies if edit=false [string]
551+
--from-last-tag uses the last tag as the lower end of the commit range to lint; applies if edit=false and from is not set [boolean]
551552
--git-log-args additional git log arguments as space separated string, example '--first-parent --cherry-pick' [string]
552553
-l, --last just analyze the last commit; applies if edit=false [boolean]
553554
-o, --format output format of the results [string]
@@ -556,6 +557,7 @@ test('should print help', async () => {
556557
-t, --to upper end of the commit range to lint; applies if edit=false [string]
557558
-V, --verbose enable verbose output for reports without problems [boolean]
558559
-s, --strict enable strict mode; result code 2 for warnings, 3 for errors [boolean]
560+
--options path to a JSON file or Common.js module containing CLI options
559561
-v, --version display version information [boolean]
560562
-h, --help Show help [boolean]"
561563
`);

@commitlint/cli/src/cli.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ const cli = yargs(process.argv.slice(2))
9090
'lower end of the commit range to lint; applies if edit=false',
9191
type: 'string',
9292
},
93+
'from-last-tag': {
94+
description:
95+
'uses the last tag as the lower end of the commit range to lint; applies if edit=false and from is not set',
96+
type: 'boolean',
97+
},
9398
'git-log-args': {
9499
description:
95100
"additional git log arguments as space separated string, example '--first-parent --cherry-pick'",
@@ -143,6 +148,11 @@ const cli = yargs(process.argv.slice(2))
143148
.alias('v', 'version')
144149
.help('help')
145150
.alias('h', 'help')
151+
.config(
152+
'options',
153+
'path to a JSON file or Common.js module containing CLI options',
154+
require
155+
)
146156
.usage(`${pkg.name}@${pkg.version} - ${pkg.description}\n`)
147157
.usage(
148158
`[input] reads from stdin if --edit, --env, --from and --to are omitted`
@@ -237,6 +247,7 @@ async function main(args: MainArgs): Promise<void> {
237247
: read({
238248
to: flags.to,
239249
from: flags.from,
250+
fromLastTag: flags['from-last-tag'],
240251
last: flags.last,
241252
edit: flags.edit,
242253
cwd: flags.cwd,
@@ -395,6 +406,7 @@ function checkFromEdit(flags: CliFlags): boolean {
395406
function checkFromHistory(flags: CliFlags): boolean {
396407
return (
397408
typeof flags.from === 'string' ||
409+
typeof flags['from-last-tag'] === 'boolean' ||
398410
typeof flags.to === 'string' ||
399411
typeof flags.last === 'boolean'
400412
);

@commitlint/cli/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface CliFlags {
88
help?: boolean;
99
'help-url'?: string;
1010
from?: string;
11+
'from-last-tag'?: boolean;
1112
'git-log-args'?: string;
1213
last?: boolean;
1314
format?: string;

@commitlint/core/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [19.4.0](https://github.com/conventional-changelog/commitlint/compare/v19.3.1...v19.4.0) (2024-08-07)
7+
8+
**Note:** Version bump only for package @commitlint/core
9+
10+
11+
12+
13+
614
# [19.3.0](https://github.com/conventional-changelog/commitlint/compare/v19.2.2...v19.3.0) (2024-04-23)
715

816
**Note:** Version bump only for package @commitlint/core

@commitlint/core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@commitlint/core",
33
"type": "module",
4-
"version": "19.3.0",
4+
"version": "19.4.0",
55
"description": "Lint your commit messages",
66
"main": "lib/core.js",
77
"types": "lib/core.d.ts",
@@ -38,8 +38,8 @@
3838
"dependencies": {
3939
"@commitlint/format": "^19.3.0",
4040
"@commitlint/lint": "^19.2.2",
41-
"@commitlint/load": "^19.2.0",
42-
"@commitlint/read": "^19.2.1"
41+
"@commitlint/load": "^19.4.0",
42+
"@commitlint/read": "^19.4.0"
4343
},
4444
"devDependencies": {
4545
"@commitlint/utils": "^19.0.0"

@commitlint/cz-commitlint/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [19.4.0](https://github.com/conventional-changelog/commitlint/compare/v19.3.1...v19.4.0) (2024-08-07)
7+
8+
**Note:** Version bump only for package @commitlint/cz-commitlint
9+
10+
11+
12+
13+
614
# [19.2.0](https://github.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) (2024-03-15)
715

816
**Note:** Version bump only for package @commitlint/cz-commitlint

@commitlint/cz-commitlint/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@commitlint/cz-commitlint",
33
"type": "module",
4-
"version": "19.2.0",
4+
"version": "19.4.0",
55
"description": "Commitizen adapter using the commitlint.config.js",
66
"main": "./lib/index.js",
77
"exports": {
@@ -44,7 +44,7 @@
4444
},
4545
"dependencies": {
4646
"@commitlint/ensure": "^19.0.3",
47-
"@commitlint/load": "^19.2.0",
47+
"@commitlint/load": "^19.4.0",
4848
"@commitlint/types": "^19.0.3",
4949
"chalk": "^5.3.0",
5050
"lodash.isplainobject": "^4.0.6",

@commitlint/load/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [19.4.0](https://github.com/conventional-changelog/commitlint/compare/v19.3.1...v19.4.0) (2024-08-07)
7+
8+
**Note:** Version bump only for package @commitlint/load
9+
10+
11+
12+
13+
614
# [19.2.0](https://github.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) (2024-03-15)
715

816

@commitlint/load/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@commitlint/load",
33
"type": "module",
4-
"version": "19.2.0",
4+
"version": "19.4.0",
55
"description": "Load shared commitlint configuration",
66
"main": "lib/load.js",
77
"types": "lib/load.d.ts",

@commitlint/load/src/utils/plugin-naming.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from 'path';
22

33
// largely adapted from eslint's plugin system
4-
const NAMESPACE_REGEX = /^@.*\//iu;
4+
const NAMESPACE_REGEX = /^@.*\//u;
55
// In eslint this is a parameter - we don't need to support the extra options
66
const prefix = 'commitlint-plugin';
77

@@ -40,7 +40,7 @@ export function normalizePackageName(name: string) {
4040
`^(@[^/]+)(?:/(?:${prefix})?)?$`,
4141
'u'
4242
),
43-
scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, 'u');
43+
scopedPackageNameRegex = new RegExp(`^${prefix}(?:-|$)`, 'u');
4444

4545
if (scopedPackageShortcutRegex.test(normalizedName)) {
4646
normalizedName = normalizedName.replace(
@@ -94,7 +94,7 @@ export function getShorthandName(fullname: string) {
9494
* @returns {string} The namepace of the term if it has one.
9595
*/
9696
export function getNamespaceFromTerm(term: string) {
97-
const match = term.match(NAMESPACE_REGEX);
97+
const match = NAMESPACE_REGEX.exec(term);
9898

9999
return match ? match[0] : '';
100100
}

@commitlint/prompt-cli/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [19.4.0](https://github.com/conventional-changelog/commitlint/compare/v19.3.1...v19.4.0) (2024-08-07)
7+
8+
**Note:** Version bump only for package @commitlint/prompt-cli
9+
10+
11+
12+
13+
614
## [19.3.1](https://github.com/conventional-changelog/commitlint/compare/v19.3.0...v19.3.1) (2024-05-13)
715

816
**Note:** Version bump only for package @commitlint/prompt-cli

@commitlint/prompt-cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@commitlint/prompt-cli",
33
"type": "module",
4-
"version": "19.3.1",
4+
"version": "19.4.0",
55
"description": "commit prompt using commitlint.config.js",
66
"main": "cli.js",
77
"files": [
@@ -38,7 +38,7 @@
3838
"@commitlint/utils": "^19.0.0"
3939
},
4040
"dependencies": {
41-
"@commitlint/prompt": "^19.3.1",
41+
"@commitlint/prompt": "^19.4.0",
4242
"execa": "^8.0.1",
4343
"inquirer": "^9.2.15"
4444
},

@commitlint/prompt/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [19.4.0](https://github.com/conventional-changelog/commitlint/compare/v19.3.1...v19.4.0) (2024-08-07)
7+
8+
**Note:** Version bump only for package @commitlint/prompt
9+
10+
11+
12+
13+
614
## [19.3.1](https://github.com/conventional-changelog/commitlint/compare/v19.3.0...v19.3.1) (2024-05-13)
715

816

@commitlint/prompt/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@commitlint/prompt",
33
"type": "module",
4-
"version": "19.3.1",
4+
"version": "19.4.0",
55
"description": "commitizen prompt using commitlint.config.js",
66
"main": "./lib/index.js",
77
"files": [
@@ -46,7 +46,7 @@
4646
},
4747
"dependencies": {
4848
"@commitlint/ensure": "^19.0.3",
49-
"@commitlint/load": "^19.2.0",
49+
"@commitlint/load": "^19.4.0",
5050
"@commitlint/types": "^19.0.3",
5151
"chalk": "^5.3.0",
5252
"inquirer": "^9.2.15"

@commitlint/read/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [19.4.0](https://github.com/conventional-changelog/commitlint/compare/v19.3.1...v19.4.0) (2024-08-07)
7+
8+
9+
### Features
10+
11+
* support linting from the last tag ([#4110](https://github.com/conventional-changelog/commitlint/issues/4110)) ([4b204ec](https://github.com/conventional-changelog/commitlint/commit/4b204ecfb43dd6a00e24b51111aadbd78f9d58e1))
12+
13+
14+
15+
16+
617
## [19.2.1](https://github.com/conventional-changelog/commitlint/compare/v19.2.0...v19.2.1) (2024-03-19)
718

819
**Note:** Version bump only for package @commitlint/read

@commitlint/read/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@commitlint/read",
33
"type": "module",
4-
"version": "19.2.1",
4+
"version": "19.4.0",
55
"description": "Read commit messages from a specified range or last edit",
66
"main": "lib/read.js",
77
"types": "lib/read.d.ts",

0 commit comments

Comments
 (0)