You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Existing behavior remains the same, so `hallmark cc add <target>`
does the same as `hallmark bump <target>` did.
The new command is more generic however: it also supports inserting
a release into the changelog for an existing version (regardless of
whether that version is first, last or somewhere in the middle).
In addition, there's a new option `--no-commits` to skip populating
the release with commits. Effectively only creating a markdown
heading (with a version number, link and date).
Closes#84
Copy file name to clipboardExpand all lines: README.md
+40-8Lines changed: 40 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,10 @@
20
20
-[Requirements](#requirements)
21
21
-[Rules](#rules)
22
22
-[Usage](#usage)
23
+
-[Commands](#commands)
24
+
-[`lint`](#lint)
25
+
-[`fix`](#fix)
26
+
-[`cc add <target>`](#cc-add-target)
23
27
-[Package Options](#package-options)
24
28
-[`ignore`](#ignore)
25
29
-[`autolinkReferences`](#autolinkreferences)
@@ -65,10 +69,11 @@ Fix custom files:
65
69
hallmark fix CHANGELOG.md docs/*.md
66
70
```
67
71
68
-
Add new minor version to changelog:
72
+
Add new minor version or existing version to changelog, optionally without content:
69
73
70
74
```
71
-
hallmark bump minor
75
+
hallmark cc add minor
76
+
hallmark cc add 4.2.0 --no-commits
72
77
```
73
78
74
79
## What You Might Do
@@ -134,13 +139,9 @@ README.md:5:3
134
139
135
140
`hallmark [command] [options] [pattern ...]`
136
141
137
-
Lint or fix files in the current working directory. By default `hallmark` includes files matching `*.md`. Pass one or more glob patterns to override this. Files matching `.gitignore` patterns are ignored. To ignore additional files, use the `--ignore / -i` option.
142
+
Lint or fix files in the current working directory. The default command is `lint`.
138
143
139
-
Commands:
140
-
141
-
-`lint`: lint markdown files (default)
142
-
-`fix`: fix markdown files
143
-
-`bump <target>`: add new entry to changelog. Target must be a release type (major, minor, patch, premajor, preminor, prepatch, prerelease) or a version.
144
+
By default `hallmark` includes files matching `*.md`. Pass one or more glob patterns to override this. Files matching `.gitignore` patterns are ignored. To ignore additional files, use the `--ignore / -i` option.
144
145
145
146
Options:
146
147
@@ -151,6 +152,37 @@ Options:
151
152
-`--[no-]color`: force color in report (detected by default)
152
153
-`--fix`: backwards-compatible alias for fix command
153
154
155
+
### Commands
156
+
157
+
#### `lint`
158
+
159
+
Lint markdown files.
160
+
161
+
#### `fix`
162
+
163
+
Fix markdown files in place.
164
+
165
+
#### `cc add <target>`
166
+
167
+
Add a release to `CHANGELOG.md` and populate it with commits. The `target` must be one of:
- These take the current version from the semver-latest tag, release or `package.json` (whichever is greatest if found) and bump it
171
+
- The `major` type bumps the major version (for example `2.4.1 => 3.0.0`); `minor` and `patch` work the same way.
172
+
- The `premajor` type bumps the version up to the next major version and down to a prerelease of that major version; `preminor` and `prepatch` work the same way.
173
+
- The `prerelease` type works the same as `prepatch` if the current version is a non-prerelease. If the current is already a prerelease then it's simply incremented (for example `4.0.0-rc.2` to `4.0.0-rc.3`).
174
+
- A [semver-valid](https://semver.org/) version like 2.4.0.
175
+
176
+
If the (resulting) version is greater than the current version then commits will be taken from the semver-latest tag until HEAD. I.e. documenting a new release before it's git-tagged. If the version matches an existing tag then a release will be inserted at the appriopriate place, populated with commits between that version's tag and the one before it. I.e. documenting a past release after it's git-tagged.
177
+
178
+
Additional options for this command:
179
+
180
+
-`--no-commits`: create an empty release.
181
+
182
+
Works best on a linear git history. If `hallmark` encounters other tags in the commit range (which may happen if releases were made in parallel on other branches) it will stop there and not include further (older) commits.
183
+
184
+
The `cc add` command also fixes markdown - both existing content and generated content. After you tweak the release following [Common Changelog](https://common-changelog.org) you may want to run `hallmark fix` again.
185
+
154
186
## Package Options
155
187
156
188
You can add a `hallmark` object to your `package.json` with additional configuration. For example:
0 commit comments