commitfmt-linux 0.4.1__tar.gz → 1.0.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: commitfmt_linux
3
- Version: 0.4.1
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
- #### Value template
236
+ #### Static value
237
237
 
238
- You can use a template to format the value of the footer. Inside of template expression you can use any shell command available at the `PATH`.
238
+ You can add a footer with a static value:
239
239
 
240
- For example, to add the `Authored-By` footer with the current user name, add the following to your config file:
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-template = "{{ echo $USER }}"
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-value-pattern = "(?:.*)/([A-Z0-9-]+)/?(?:.*)"
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
- ##### Recipes
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: `(?:.*)/#?([0-9-]+)/?(?:.*)`
272
- - `feature/#123`
282
+ - GitHub: `(?:.*)/(?<ISSUE_ID>[0-9-]+)/?(?:.*)`
273
283
  - `feature/123`
274
- - `feature/#123/add-new-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-value-pattern = "(?:.*)/([A-Z0-9-]+)/?(?:.*)"
284
- on-conflict = "skip" # skip, append, error
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:
@@ -155,7 +155,7 @@ Most of the linting rules are disabled by default. Default config contains 2 rul
155
155
 
156
156
  ```toml
157
157
  [lint.header]
158
- full-stop = true
158
+ description-full-stop = true
159
159
 
160
160
  [lint.footer]
161
161
  breaking-exclamation = true
@@ -214,26 +214,37 @@ Lines starting with the comment symbol will be ignored during parsing.
214
214
 
215
215
  commitfmt can add additional footers to the commit message.
216
216
 
217
- #### Value template
217
+ #### Static value
218
218
 
219
- You can use a template to format the value of the footer. Inside of template expression you can use any shell command available at the `PATH`.
219
+ You can add a footer with a static value:
220
220
 
221
- For example, to add the `Authored-By` footer with the current user name, add the following to your config file:
221
+ ```toml
222
+ [[additional-footers]]
223
+ key = "Authored-By"
224
+ value = "John Doe"
225
+ ```
226
+
227
+ #### Shell commands
228
+
229
+ You can use shell commands to dynamically generate footer values:
222
230
 
223
231
  ```toml
224
- [additional-footers]
232
+ [[additional-footers]]
225
233
  key = "Authored-By"
226
- value-template = "{{ echo $USER }}"
234
+ value = "{{ echo $USER }}"
227
235
  ```
228
236
 
237
+ Inside the template expression you can use any shell command available in the `PATH`.
238
+
229
239
  #### Branch value pattern
230
240
 
231
241
  You can also add the ticket number from the task tracker to the footer if it is in the branch name:
232
242
 
233
243
  ```toml
234
- [additional-footers]
244
+ [[additional-footers]]
235
245
  key = "Ticket-ID"
236
- branch-value-pattern = "(?:.*)/([A-Z0-9-]+)/?(?:.*)"
246
+ branch-pattern = "(?:.*)/(?<TICKET_ID>[A-Z0-9-]+)/?(?:.*)"
247
+ value = "${{ TICKET_ID }}"
237
248
  ```
238
249
 
239
250
  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`.
@@ -242,27 +253,27 @@ If the ticket number is not found in the branch name, footer will be skipped.
242
253
 
243
254
  You can use [rustexp](https://rustexp.lpil.uk) to test your pattern.
244
255
 
245
- ##### Recipes
256
+ ##### Patterns
246
257
 
247
258
  Examples of patterns for branch names in git flow format:
248
259
 
249
- - Jira/YouTrack: `(?:.*)/([A-Z0-9-]+)/?(?:.*)`
260
+ - Jira/YouTrack: `(?:.*)/(?<TICKET_ID>[A-Z0-9-]+)/?(?:.*)`
250
261
  - `feature/CFMT-123`
251
262
  - `feature/CFMT-123/add-new-feature`
252
- - GitHub: `(?:.*)/#?([0-9-]+)/?(?:.*)`
253
- - `feature/#123`
263
+ - GitHub: `(?:.*)/(?<ISSUE_ID>[0-9-]+)/?(?:.*)`
254
264
  - `feature/123`
255
- - `feature/#123/add-new-feature`
265
+ - `feature/123/add-new-feature`
256
266
 
257
267
  #### On conflict
258
268
 
259
269
  If the footer already exists in the commit message, you can specify what to do with it. By default, the footer will be skipped.
260
270
 
261
271
  ```toml
262
- [additional-footers]
272
+ [[additional-footers]]
263
273
  key = "Ticket-ID"
264
- branch-value-pattern = "(?:.*)/([A-Z0-9-]+)/?(?:.*)"
265
- on-conflict = "skip" # skip, append, error
274
+ branch-pattern = "(?:.*)/(?<TICKET_ID>[A-Z0-9-]+)/?(?:.*)"
275
+ value = "${{ TICKET_ID }}"
276
+ on-conflict = "error" # optional. default: skip. available: skip, append, error
266
277
  ```
267
278
 
268
279
  Available options:
@@ -271,6 +282,44 @@ Available options:
271
282
  - `append` - append the footer to the end of the footer list
272
283
  - `error` - abort the commit
273
284
 
285
+ #### Footer formatting
286
+
287
+ You can customize how footers are formatted using `separator` and `alignment` options:
288
+
289
+ ```toml
290
+ [[additional-footers]]
291
+ key = "Ticket-ID"
292
+ value = "CFMT-123"
293
+ separator = "#"
294
+ alignment = "right"
295
+ ```
296
+
297
+ Available alignment options:
298
+
299
+ - `left` - align separator to the left (default)
300
+ - `right` - align separator to the right
301
+
302
+ ### Recipe
303
+
304
+ To enforce conventional commits, you can use the following configuration:
305
+
306
+ ```toml
307
+ [lint.header]
308
+ type-enum = ["chore", "ci", "feat", "fix", "refactor", "style", "test", "docs"]
309
+ description-case = "lower-first"
310
+ description-max-length = 72
311
+ description-full-stop = true
312
+ type-required = true
313
+ # scope-enum = ["cc", "config", "git", "linter"] # optional
314
+
315
+ [lint.body]
316
+ max-line-length = 72
317
+ case = "upper-first"
318
+
319
+ [lint.footer]
320
+ breaking-exclamation = true
321
+ ```
322
+
274
323
  ## Testing
275
324
 
276
325
  To test the configuration and the work of commitfmt, run the following command:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: commitfmt_linux
3
- Version: 0.4.1
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
- #### Value template
236
+ #### Static value
237
237
 
238
- You can use a template to format the value of the footer. Inside of template expression you can use any shell command available at the `PATH`.
238
+ You can add a footer with a static value:
239
239
 
240
- For example, to add the `Authored-By` footer with the current user name, add the following to your config file:
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-template = "{{ echo $USER }}"
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-value-pattern = "(?:.*)/([A-Z0-9-]+)/?(?:.*)"
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
- ##### Recipes
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: `(?:.*)/#?([0-9-]+)/?(?:.*)`
272
- - `feature/#123`
282
+ - GitHub: `(?:.*)/(?<ISSUE_ID>[0-9-]+)/?(?:.*)`
273
283
  - `feature/123`
274
- - `feature/#123/add-new-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-value-pattern = "(?:.*)/([A-Z0-9-]+)/?(?:.*)"
284
- on-conflict = "skip" # skip, append, error
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:
@@ -6,7 +6,7 @@ authors = [
6
6
  description = "Utility for formatting and verifying the commit message."
7
7
  readme = "README.md"
8
8
  requires-python = ">=3.9"
9
- version = "0.4.1"
9
+ version = "1.0.0"
10
10
  keywords = ["git", "hook"]
11
11
  license = {text = "MIT"}
12
12
  classifiers = [