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
{{ message }}
Repository navigation
Commit d51bdc0
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -387,8 +387,8 @@ the same thing twice, so read the description rather than the cell:
387
387
| commit | message_pattern | str | "" (no custom pattern) | Custom regex pattern for commit message validation. When set, this pattern replaces the auto-generated Conventional Commits regex entirely, making it possible to enforce custom formats such as JIRA smart commits (e.g., `"^PROJ-\\d+: .+"`). When `message_pattern` is set (non-empty) it takes precedence over `conventional_commits`. |
388
388
| commit | subject_capitalized | bool | false | Subject must start with a capital letter. |
389
389
| commit | subject_imperative | bool | false | Subject must be in imperative mood. Judged on the first word's form, so a verb no list contains is still accepted — see [CC003](rules.md#cc003). |
390
-
| commit | subject_max_length | int | 80 | Maximum length of the subject line. |
391
-
| commit | subject_min_length | int | 5 | Minimum length of the subject line. |
390
+
| commit | subject_max_length | int | 80 | Maximum length of the subject line. `0` turns the check off. |
391
+
| commit | subject_min_length | int | 5 | Minimum length of the subject line. `0` turns the check off. |
OpenHands, Factory Droid and Jules, the disclosure trailers `Assisted-by:` and
144
+
OpenHands, Factory Droid, Jules, Continue, Mistral Vibe and Qwen Code, the
145
+
disclosure trailers `Assisted-by:` and
145
146
`Generated-by:`, vendor marks such as `🤖 Generated with Claude Code`, Amp's
146
147
`Amp-Thread-ID:`, the Copilot coding agent's `Agent-Logs-Url:` and Cursor's
147
148
`Made-with: Cursor`, and generic AI model names. This is the
@@ -166,6 +167,40 @@ also commits as its own account, but every commit it makes carries an
166
167
mechanism against those who aren't. Be clear with yourself about which of
167
168
those you are buying.
168
169
170
+
### Checking AI attribution and nothing else
171
+
172
+
`ai_attribution` sits alongside the message rules that are on by default, so
173
+
`--message` still applies Conventional Commits and the subject length limits
174
+
(80 characters at most, 5 at least). A project that has its own commit style
175
+
and only wants the AI check turns those off:
176
+
177
+
```toml title="cchk.toml"
178
+
[commit]
179
+
ai_attribution = "forbid"
180
+
conventional_commits = false
181
+
subject_max_length = 0# 0 turns the length rule off
182
+
subject_min_length = 0
183
+
```
184
+
185
+
Or, in the GitHub Action, without a config file:
186
+
187
+
```yaml
188
+
- uses: commit-check/commit-check-action@v2
189
+
env:
190
+
CCHK_AI_ATTRIBUTION: forbid
191
+
CCHK_CONVENTIONAL_COMMITS: false
192
+
CCHK_SUBJECT_MAX_LENGTH: 0
193
+
CCHK_SUBJECT_MIN_LENGTH: 0
194
+
with:
195
+
message: true
196
+
branch: false
197
+
```
198
+
199
+
Leave the length limits on and a long subject fails the job too. Dependency
200
+
bots write long ones: Renovate's `Update dependency
201
+
com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer to
202
+
v20261103` is 95 characters.
203
+
169
204
### Asking for disclosure instead
170
205
171
206
Most projects that allow AI assistance ask to be told about it.
@@ -288,6 +323,47 @@ triagers judge each contribution by whether its author can explain it in their
288
323
own words. A policy like that leaves nothing for commit-check to enforce, so
289
324
keep `ai_attribution` at its default, `"ignore"`.
290
325
326
+
### Recipes from real projects
327
+
328
+
Many projects enforce their AI policy with a hand-written grep step in CI.
329
+
Each policy below fits in a few lines of `cchk.toml`. Add
330
+
`conventional_commits = false`if your project does not use Conventional
331
+
Commits (see [Checking AI attribution and nothing else](#checking-ai-attribution-and-nothing-else)).
332
+
333
+
| Project | Its rule for commits | `cchk.toml` |
334
+
|---|---|---|
335
+
| [Kubernetes](https://www.kubernetes.dev/docs/guide/pull-requests/) | No AI co-author, no AI sign-off, no `Assisted-by` | `ai_attribution = "forbid"` |
336
+
| [Linux kernel](https://docs.kernel.org/process/coding-assistants.html) | Every commit signed off by a person; an AI never signs off | `ai_attribution = "disclose"`, `require_signed_off_by = true`, top-level `warn = ["ai_disclosure"]` |
337
+
| Nextcloud | `Assisted-by: AGENT_NAME:MODEL_VERSION` on AI-assisted commits; an AI never signs off | `ai_attribution = "disclose"`, `ai_disclosure_pattern = '^[^:\s]+:\S+'` |
338
+
| [pip](https://github.com/pypa/pip/blob/main/AI_POLICY.md), [attrs](https://github.com/python-attrs/attrs/blob/main/.github/AI_POLICY.md) | No AI co-author; disclosure not required | `ai_attribution = "disclose"`, top-level `warn = ["ai_disclosure"]` |
0 commit comments