git-commit-guard 0.7.0__tar.gz → 0.9.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.
Files changed (26) hide show
  1. git_commit_guard-0.9.0/.github/workflows/lint-python.yml +24 -0
  2. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/PKG-INFO +68 -3
  3. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/README.md +67 -2
  4. git_commit_guard-0.9.0/htmlcov/.gitignore +2 -0
  5. git_commit_guard-0.9.0/htmlcov/class_index.html +161 -0
  6. git_commit_guard-0.9.0/htmlcov/coverage_html_cb_dd2e7eb5.js +735 -0
  7. git_commit_guard-0.9.0/htmlcov/favicon_32_cb_c827f16f.png +0 -0
  8. git_commit_guard-0.9.0/htmlcov/function_index.html +331 -0
  9. git_commit_guard-0.9.0/htmlcov/index.html +117 -0
  10. git_commit_guard-0.9.0/htmlcov/keybd_closed_cb_900cfef5.png +0 -0
  11. git_commit_guard-0.9.0/htmlcov/status.json +1 -0
  12. git_commit_guard-0.9.0/htmlcov/style_cb_9ff733b0.css +389 -0
  13. git_commit_guard-0.9.0/htmlcov/z_262b75d81d1cf686___init___py.html +454 -0
  14. git_commit_guard-0.9.0/ruff.toml +13 -0
  15. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/src/git_commit_guard/__init__.py +138 -13
  16. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/tests/test_git_commit_guard.py +372 -3
  17. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/.github/workflows/lint-commits.yml +0 -0
  18. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/.github/workflows/lint-md.yml +0 -0
  19. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/.github/workflows/test.yml +0 -0
  20. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/.gitignore +0 -0
  21. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/.pre-commit-hooks.yaml +0 -0
  22. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/.python-version +0 -0
  23. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/LICENSE +0 -0
  24. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/pyproject.toml +0 -0
  25. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/tests/__init__.py +0 -0
  26. {git_commit_guard-0.7.0 → git_commit_guard-0.9.0}/uv.lock +0 -0
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: Lint Python
3
+ on: # yamllint disable-line rule:truthy
4
+ pull_request:
5
+ permissions:
6
+ contents: read
7
+ jobs:
8
+ lint-python:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ checks: write
12
+ pull-requests: write
13
+ steps:
14
+ - name: Checkout code
15
+ # yamllint disable-line rule:line-length
16
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17
+ with:
18
+ persist-credentials: false
19
+ - name: Run ruff
20
+ # yamllint disable-line rule:line-length
21
+ uses: benner/action-ruff@b36eb590165f0ea36700bb92de15235c121f24f0 # v0.1.0
22
+ with:
23
+ fail_level: error
24
+ reporter: github-pr-review
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-commit-guard
3
- Version: 0.7.0
3
+ Version: 0.9.0
4
4
  Summary: Opinionated conventional commit message linter with imperative mood detection
5
5
  Project-URL: Homepage, https://github.com/benner/commit-guard
6
6
  Project-URL: Repository, https://github.com/benner/commit-guard
@@ -101,6 +101,70 @@ Available checks:
101
101
  * `signed-off` - `Signed-off-by:` trailer exists
102
102
  * `signature` - Verify GPG or SSH signature
103
103
 
104
+ ### Subject length
105
+
106
+ The default maximum subject line length is 72 characters. Override with
107
+ `--max-subject-length`:
108
+
109
+ ```bash
110
+ commit-guard --max-subject-length 100
111
+ ```
112
+
113
+ ### Type validation
114
+
115
+ By default the standard conventional commit types are accepted. Use `--types`
116
+ to replace the allowed set entirely:
117
+
118
+ ```bash
119
+ # restrict to a subset
120
+ commit-guard --types feat,fix,chore
121
+
122
+ # add a project-specific type
123
+ commit-guard --types feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert,wip
124
+ ```
125
+
126
+ ### Scope validation
127
+
128
+ By default any scope is accepted and scope is optional. Use `--scopes` to
129
+ restrict allowed values and `--require-scope` to enforce that a scope is always
130
+ present:
131
+
132
+ ```bash
133
+ # only allow known scopes
134
+ commit-guard --scopes auth,api,db
135
+
136
+ # require a scope
137
+ commit-guard --require-scope
138
+
139
+ # combine both
140
+ commit-guard --scopes auth,api --require-scope
141
+ ```
142
+
143
+ ### Configuration file
144
+
145
+ Place `.commit-guard.toml` in your project root (or any parent directory) to
146
+ set defaults for `enable`, `disable`, `scopes`, `require-scope`, `types`, and
147
+ `max-subject-length`. commit-guard searches upward from the working directory
148
+ and uses the first file found.
149
+
150
+ ```toml
151
+ # .commit-guard.toml
152
+ disable = ["signature", "body"]
153
+ scopes = ["auth", "api", "db"]
154
+ require-scope = true
155
+ types = ["feat", "fix", "chore", "wip"]
156
+ max-subject-length = 100
157
+ ```
158
+
159
+ ```toml
160
+ # .commit-guard.toml
161
+ enable = ["subject", "imperative"]
162
+ ```
163
+
164
+ CLI flags (`--enable`, `--disable`, `--scopes`, `--require-scope`, `--types`,
165
+ `--max-subject-length`) take full precedence and ignore config file values when
166
+ provided.
167
+
104
168
  ### Checking a range of commits
105
169
 
106
170
  ```bash
@@ -167,8 +231,9 @@ body
167
231
  trailers
168
232
  ```
169
233
 
170
- Supported types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`,
171
- `build`, `ci`, `chore`, `revert`.
234
+ Default types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`,
235
+ `build`, `ci`, `chore`, `revert`. Override with `--types` or the `types` config
236
+ key.
172
237
 
173
238
  Scope is optional. Mark breaking changes with `!` before
174
239
  the colon.
@@ -80,6 +80,70 @@ Available checks:
80
80
  * `signed-off` - `Signed-off-by:` trailer exists
81
81
  * `signature` - Verify GPG or SSH signature
82
82
 
83
+ ### Subject length
84
+
85
+ The default maximum subject line length is 72 characters. Override with
86
+ `--max-subject-length`:
87
+
88
+ ```bash
89
+ commit-guard --max-subject-length 100
90
+ ```
91
+
92
+ ### Type validation
93
+
94
+ By default the standard conventional commit types are accepted. Use `--types`
95
+ to replace the allowed set entirely:
96
+
97
+ ```bash
98
+ # restrict to a subset
99
+ commit-guard --types feat,fix,chore
100
+
101
+ # add a project-specific type
102
+ commit-guard --types feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert,wip
103
+ ```
104
+
105
+ ### Scope validation
106
+
107
+ By default any scope is accepted and scope is optional. Use `--scopes` to
108
+ restrict allowed values and `--require-scope` to enforce that a scope is always
109
+ present:
110
+
111
+ ```bash
112
+ # only allow known scopes
113
+ commit-guard --scopes auth,api,db
114
+
115
+ # require a scope
116
+ commit-guard --require-scope
117
+
118
+ # combine both
119
+ commit-guard --scopes auth,api --require-scope
120
+ ```
121
+
122
+ ### Configuration file
123
+
124
+ Place `.commit-guard.toml` in your project root (or any parent directory) to
125
+ set defaults for `enable`, `disable`, `scopes`, `require-scope`, `types`, and
126
+ `max-subject-length`. commit-guard searches upward from the working directory
127
+ and uses the first file found.
128
+
129
+ ```toml
130
+ # .commit-guard.toml
131
+ disable = ["signature", "body"]
132
+ scopes = ["auth", "api", "db"]
133
+ require-scope = true
134
+ types = ["feat", "fix", "chore", "wip"]
135
+ max-subject-length = 100
136
+ ```
137
+
138
+ ```toml
139
+ # .commit-guard.toml
140
+ enable = ["subject", "imperative"]
141
+ ```
142
+
143
+ CLI flags (`--enable`, `--disable`, `--scopes`, `--require-scope`, `--types`,
144
+ `--max-subject-length`) take full precedence and ignore config file values when
145
+ provided.
146
+
83
147
  ### Checking a range of commits
84
148
 
85
149
  ```bash
@@ -146,8 +210,9 @@ body
146
210
  trailers
147
211
  ```
148
212
 
149
- Supported types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`,
150
- `build`, `ci`, `chore`, `revert`.
213
+ Default types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`,
214
+ `build`, `ci`, `chore`, `revert`. Override with `--types` or the `types` config
215
+ key.
151
216
 
152
217
  Scope is optional. Mark breaking changes with `!` before
153
218
  the colon.
@@ -0,0 +1,2 @@
1
+ # Created by coverage.py
2
+ *
@@ -0,0 +1,161 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Coverage report</title>
6
+ <link rel="icon" sizes="32x32" href="favicon_32_cb_c827f16f.png">
7
+ <link rel="stylesheet" href="style_cb_9ff733b0.css" type="text/css">
8
+ <script src="coverage_html_cb_dd2e7eb5.js" defer></script>
9
+ </head>
10
+ <body class="indexfile">
11
+ <header>
12
+ <div class="content">
13
+ <h1>Coverage report:
14
+ <span class="pc_cov">99%</span>
15
+ </h1>
16
+ <aside id="help_panel_wrapper">
17
+ <input id="help_panel_state" type="checkbox">
18
+ <label for="help_panel_state">
19
+ <img id="keyboard_icon" src="keybd_closed_cb_900cfef5.png" alt="Show/hide keyboard shortcuts">
20
+ </label>
21
+ <div id="help_panel">
22
+ <p class="legend">Shortcuts on this page</p>
23
+ <div class="keyhelp">
24
+ <p>
25
+ <kbd>f</kbd>
26
+ <kbd>n</kbd>
27
+ <kbd>s</kbd>
28
+ <kbd>m</kbd>
29
+ <kbd>x</kbd>
30
+ <kbd>c</kbd>
31
+ &nbsp; change column sorting
32
+ </p>
33
+ <p>
34
+ <kbd>[</kbd>
35
+ <kbd>]</kbd>
36
+ &nbsp; prev/next file
37
+ </p>
38
+ <p>
39
+ <kbd>?</kbd> &nbsp; show/hide this help
40
+ </p>
41
+ </div>
42
+ </div>
43
+ </aside>
44
+ <form id="filter_container">
45
+ <input id="filter" type="text" value="" placeholder="filter...">
46
+ <div>
47
+ <input id="hide100" type="checkbox" >
48
+ <label for="hide100">hide covered</label>
49
+ </div>
50
+ </form>
51
+ <h2>
52
+ <a class="button" href="index.html">Files</a>
53
+ <a class="button" href="function_index.html">Functions</a>
54
+ <a class="button current">Classes</a>
55
+ </h2>
56
+ <p class="text">
57
+ <a class="nav" href="https://coverage.readthedocs.io/en/7.13.5">coverage.py v7.13.5</a>,
58
+ created at 2026-04-18 23:09 +0300
59
+ </p>
60
+ </div>
61
+ </header>
62
+ <main id="index">
63
+ <table class="index" data-sortable>
64
+ <thead>
65
+ <tr class="tablehead" title="Click to sort">
66
+ <th id="file" class="name" aria-sort="none" data-shortcut="f">File<span class="arrows"></span></th>
67
+ <th id="region" class="name" aria-sort="none" data-default-sort-order="ascending" data-shortcut="n">class<span class="arrows"></span></th>
68
+ <th class="spacer">&nbsp;</th>
69
+ <th id="statements" aria-sort="none" data-default-sort-order="descending" data-shortcut="s">statements<span class="arrows"></span></th>
70
+ <th id="missing" aria-sort="none" data-default-sort-order="descending" data-shortcut="m">missing<span class="arrows"></span></th>
71
+ <th id="excluded" aria-sort="none" data-default-sort-order="descending" data-shortcut="x">excluded<span class="arrows"></span></th>
72
+ <th class="spacer">&nbsp;</th>
73
+ <th id="coverage" aria-sort="none" data-shortcut="c">coverage<span class="arrows"></span></th>
74
+ </tr>
75
+ </thead>
76
+ <tbody>
77
+ <tr class="region">
78
+ <td class="name"><a href="z_262b75d81d1cf686___init___py.html#t44">src&#8201;/&#8201;git_commit_guard&#8201;/&#8201;__init__.py</a></td>
79
+ <td class="name"><a href="z_262b75d81d1cf686___init___py.html#t44"><data value='Check'>Check</data></a></td>
80
+ <td class="spacer">&nbsp;</td>
81
+ <td>0</td>
82
+ <td>0</td>
83
+ <td>0</td>
84
+ <td class="spacer">&nbsp;</td>
85
+ <td data-ratio="0 0">100%</td>
86
+ </tr>
87
+ <tr class="region">
88
+ <td class="name"><a href="z_262b75d81d1cf686___init___py.html#t72">src&#8201;/&#8201;git_commit_guard&#8201;/&#8201;__init__.py</a></td>
89
+ <td class="name"><a href="z_262b75d81d1cf686___init___py.html#t72"><data value='Level'>Level</data></a></td>
90
+ <td class="spacer">&nbsp;</td>
91
+ <td>0</td>
92
+ <td>0</td>
93
+ <td>0</td>
94
+ <td class="spacer">&nbsp;</td>
95
+ <td data-ratio="0 0">100%</td>
96
+ </tr>
97
+ <tr class="region">
98
+ <td class="name"><a href="z_262b75d81d1cf686___init___py.html#t86">src&#8201;/&#8201;git_commit_guard&#8201;/&#8201;__init__.py</a></td>
99
+ <td class="name"><a href="z_262b75d81d1cf686___init___py.html#t86"><data value='Result'>Result</data></a></td>
100
+ <td class="spacer">&nbsp;</td>
101
+ <td>4</td>
102
+ <td>0</td>
103
+ <td>0</td>
104
+ <td class="spacer">&nbsp;</td>
105
+ <td data-ratio="4 4">100%</td>
106
+ </tr>
107
+ <tr class="region">
108
+ <td class="name"><a href="z_262b75d81d1cf686___init___py.html#t218">src&#8201;/&#8201;git_commit_guard&#8201;/&#8201;__init__.py</a></td>
109
+ <td class="name"><a href="z_262b75d81d1cf686___init___py.html#t218"><data value='Args'>Args</data></a></td>
110
+ <td class="spacer">&nbsp;</td>
111
+ <td>0</td>
112
+ <td>0</td>
113
+ <td>0</td>
114
+ <td class="spacer">&nbsp;</td>
115
+ <td data-ratio="0 0">100%</td>
116
+ </tr>
117
+ <tr class="region">
118
+ <td class="name"><a href="z_262b75d81d1cf686___init___py.html">src&#8201;/&#8201;git_commit_guard&#8201;/&#8201;__init__.py</a></td>
119
+ <td class="name"><a href="z_262b75d81d1cf686___init___py.html"><data value=''><span class='no-noun'>(no class)</span></data></a></td>
120
+ <td class="spacer">&nbsp;</td>
121
+ <td>212</td>
122
+ <td>2</td>
123
+ <td>0</td>
124
+ <td class="spacer">&nbsp;</td>
125
+ <td data-ratio="210 212">99%</td>
126
+ </tr>
127
+ </tbody>
128
+ <tfoot>
129
+ <tr class="total">
130
+ <td class="name">Total</td>
131
+ <td class="name">&nbsp;</td>
132
+ <td class="spacer">&nbsp;</td>
133
+ <td>216</td>
134
+ <td>2</td>
135
+ <td>0</td>
136
+ <td class="spacer">&nbsp;</td>
137
+ <td data-ratio="214 216">99%</td>
138
+ </tr>
139
+ </tfoot>
140
+ </table>
141
+ <p id="no_rows">
142
+ No items found using the specified filter.
143
+ </p>
144
+ </main>
145
+ <footer>
146
+ <div class="content">
147
+ <p>
148
+ <a class="nav" href="https://coverage.readthedocs.io/en/7.13.5">coverage.py v7.13.5</a>,
149
+ created at 2026-04-18 23:09 +0300
150
+ </p>
151
+ </div>
152
+ <aside class="hidden">
153
+ <a id="prevFileLink" class="nav" href=""></a>
154
+ <a id="nextFileLink" class="nav" href=""></a>
155
+ <button type="button" class="button_prev_file" data-shortcut="["></button>
156
+ <button type="button" class="button_next_file" data-shortcut="]"></button>
157
+ <button type="button" class="button_show_hide_help" data-shortcut="?"></button>
158
+ </aside>
159
+ </footer>
160
+ </body>
161
+ </html>