commitfmt-linux 0.4.1__py3-none-any.whl → 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {commitfmt_linux-0.4.1.dist-info → commitfmt_linux-1.0.0.dist-info}/METADATA +66 -17
- commitfmt_linux-1.0.0.dist-info/RECORD +5 -0
- commitfmt_linux-0.4.1.dist-info/RECORD +0 -5
- {commitfmt_linux-0.4.1.dist-info → commitfmt_linux-1.0.0.dist-info}/WHEEL +0 -0
- {commitfmt_linux-0.4.1.dist-info → commitfmt_linux-1.0.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: commitfmt_linux
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Utility for formatting and verifying the commit message.
|
|
5
5
|
Author-email: Mikhael Khrustik <misha@myrt.co>
|
|
6
6
|
License: MIT
|
|
@@ -174,7 +174,7 @@ Most of the linting rules are disabled by default. Default config contains 2 rul
|
|
|
174
174
|
|
|
175
175
|
```toml
|
|
176
176
|
[lint.header]
|
|
177
|
-
full-stop = true
|
|
177
|
+
description-full-stop = true
|
|
178
178
|
|
|
179
179
|
[lint.footer]
|
|
180
180
|
breaking-exclamation = true
|
|
@@ -233,26 +233,37 @@ Lines starting with the comment symbol will be ignored during parsing.
|
|
|
233
233
|
|
|
234
234
|
commitfmt can add additional footers to the commit message.
|
|
235
235
|
|
|
236
|
-
####
|
|
236
|
+
#### Static value
|
|
237
237
|
|
|
238
|
-
You can
|
|
238
|
+
You can add a footer with a static value:
|
|
239
239
|
|
|
240
|
-
|
|
240
|
+
```toml
|
|
241
|
+
[[additional-footers]]
|
|
242
|
+
key = "Authored-By"
|
|
243
|
+
value = "John Doe"
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
#### Shell commands
|
|
247
|
+
|
|
248
|
+
You can use shell commands to dynamically generate footer values:
|
|
241
249
|
|
|
242
250
|
```toml
|
|
243
|
-
[additional-footers]
|
|
251
|
+
[[additional-footers]]
|
|
244
252
|
key = "Authored-By"
|
|
245
|
-
value
|
|
253
|
+
value = "{{ echo $USER }}"
|
|
246
254
|
```
|
|
247
255
|
|
|
256
|
+
Inside the template expression you can use any shell command available in the `PATH`.
|
|
257
|
+
|
|
248
258
|
#### Branch value pattern
|
|
249
259
|
|
|
250
260
|
You can also add the ticket number from the task tracker to the footer if it is in the branch name:
|
|
251
261
|
|
|
252
262
|
```toml
|
|
253
|
-
[additional-footers]
|
|
263
|
+
[[additional-footers]]
|
|
254
264
|
key = "Ticket-ID"
|
|
255
|
-
branch-
|
|
265
|
+
branch-pattern = "(?:.*)/(?<TICKET_ID>[A-Z0-9-]+)/?(?:.*)"
|
|
266
|
+
value = "${{ TICKET_ID }}"
|
|
256
267
|
```
|
|
257
268
|
|
|
258
269
|
For example, if your branch name is `feature/CC-123/add-new-feature` or `feature/CC-123`, the `Ticket-ID` footer will be added to the commit message with the value `CC-123`.
|
|
@@ -261,27 +272,27 @@ If the ticket number is not found in the branch name, footer will be skipped.
|
|
|
261
272
|
|
|
262
273
|
You can use [rustexp](https://rustexp.lpil.uk) to test your pattern.
|
|
263
274
|
|
|
264
|
-
#####
|
|
275
|
+
##### Patterns
|
|
265
276
|
|
|
266
277
|
Examples of patterns for branch names in git flow format:
|
|
267
278
|
|
|
268
|
-
- Jira/YouTrack: `(?:.*)/([A-Z0-9-]+)/?(?:.*)`
|
|
279
|
+
- Jira/YouTrack: `(?:.*)/(?<TICKET_ID>[A-Z0-9-]+)/?(?:.*)`
|
|
269
280
|
- `feature/CFMT-123`
|
|
270
281
|
- `feature/CFMT-123/add-new-feature`
|
|
271
|
-
- GitHub: `(?:.*)
|
|
272
|
-
- `feature/#123`
|
|
282
|
+
- GitHub: `(?:.*)/(?<ISSUE_ID>[0-9-]+)/?(?:.*)`
|
|
273
283
|
- `feature/123`
|
|
274
|
-
- `feature
|
|
284
|
+
- `feature/123/add-new-feature`
|
|
275
285
|
|
|
276
286
|
#### On conflict
|
|
277
287
|
|
|
278
288
|
If the footer already exists in the commit message, you can specify what to do with it. By default, the footer will be skipped.
|
|
279
289
|
|
|
280
290
|
```toml
|
|
281
|
-
[additional-footers]
|
|
291
|
+
[[additional-footers]]
|
|
282
292
|
key = "Ticket-ID"
|
|
283
|
-
branch-
|
|
284
|
-
|
|
293
|
+
branch-pattern = "(?:.*)/(?<TICKET_ID>[A-Z0-9-]+)/?(?:.*)"
|
|
294
|
+
value = "${{ TICKET_ID }}"
|
|
295
|
+
on-conflict = "error" # optional. default: skip. available: skip, append, error
|
|
285
296
|
```
|
|
286
297
|
|
|
287
298
|
Available options:
|
|
@@ -290,6 +301,44 @@ Available options:
|
|
|
290
301
|
- `append` - append the footer to the end of the footer list
|
|
291
302
|
- `error` - abort the commit
|
|
292
303
|
|
|
304
|
+
#### Footer formatting
|
|
305
|
+
|
|
306
|
+
You can customize how footers are formatted using `separator` and `alignment` options:
|
|
307
|
+
|
|
308
|
+
```toml
|
|
309
|
+
[[additional-footers]]
|
|
310
|
+
key = "Ticket-ID"
|
|
311
|
+
value = "CFMT-123"
|
|
312
|
+
separator = "#"
|
|
313
|
+
alignment = "right"
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Available alignment options:
|
|
317
|
+
|
|
318
|
+
- `left` - align separator to the left (default)
|
|
319
|
+
- `right` - align separator to the right
|
|
320
|
+
|
|
321
|
+
### Recipe
|
|
322
|
+
|
|
323
|
+
To enforce conventional commits, you can use the following configuration:
|
|
324
|
+
|
|
325
|
+
```toml
|
|
326
|
+
[lint.header]
|
|
327
|
+
type-enum = ["chore", "ci", "feat", "fix", "refactor", "style", "test", "docs"]
|
|
328
|
+
description-case = "lower-first"
|
|
329
|
+
description-max-length = 72
|
|
330
|
+
description-full-stop = true
|
|
331
|
+
type-required = true
|
|
332
|
+
# scope-enum = ["cc", "config", "git", "linter"] # optional
|
|
333
|
+
|
|
334
|
+
[lint.body]
|
|
335
|
+
max-line-length = 72
|
|
336
|
+
case = "upper-first"
|
|
337
|
+
|
|
338
|
+
[lint.footer]
|
|
339
|
+
breaking-exclamation = true
|
|
340
|
+
```
|
|
341
|
+
|
|
293
342
|
## Testing
|
|
294
343
|
|
|
295
344
|
To test the configuration and the work of commitfmt, run the following command:
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
commitfmt_linux/__init__.py,sha256=N5cpNKEYYrVRlEGVenMAfJyE80zm2znA33zwxjuo0e0,25
|
|
2
|
+
commitfmt_linux-1.0.0.dist-info/METADATA,sha256=fe18ruwE2fevE7kmw3WYBGjXQ0TcLuEitlcpFMTpFhQ,9908
|
|
3
|
+
commitfmt_linux-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
4
|
+
commitfmt_linux-1.0.0.dist-info/top_level.txt,sha256=KwB-TV2AfS1HLrHQ_it0d9NqEFJv8rKLW0B-x_vRFio,16
|
|
5
|
+
commitfmt_linux-1.0.0.dist-info/RECORD,,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
commitfmt_linux/__init__.py,sha256=N5cpNKEYYrVRlEGVenMAfJyE80zm2znA33zwxjuo0e0,25
|
|
2
|
-
commitfmt_linux-0.4.1.dist-info/METADATA,sha256=1ZbTci8HwBeBj6-kV4c5Nf48vnDBizQJwFrjJvhrTsw,8955
|
|
3
|
-
commitfmt_linux-0.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
4
|
-
commitfmt_linux-0.4.1.dist-info/top_level.txt,sha256=KwB-TV2AfS1HLrHQ_it0d9NqEFJv8rKLW0B-x_vRFio,16
|
|
5
|
-
commitfmt_linux-0.4.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|