openpencil/commitlint.config.ts
Danila Poyarkov 1aa10a4fed
build(tools): group tools by role and gate them like the rest of the repo (#791)
Tools live under tools/<role>/<domain> (checks, generate, release, ci, dev), every tool is a workspace named @open-pencil/<domain>-tools, a shared tools/tsconfig.json backs the new check:tools gate that fixed 55 latent type errors, test:tools runs through bun --filter, the placement check is its own checks/test-homes package, and every tool resolves the repository through resolveWorkspaceRoot. Bun, Node, and mdast types live in a tools-root workspace so they never reach the app program.
2026-09-30 05:00:31 +04:00

32 lines
1.1 KiB
TypeScript

import isIgnored from '@commitlint/is-ignored'
import type { UserConfig } from '@commitlint/types'
import { hasAICoauthor, noAICoauthors } from './tools/ci/policy/src/commit-attribution'
export default {
extends: ['@commitlint/config-conventional'],
// Apply attribution policy before allowing generated-message or release exceptions.
defaultIgnores: false,
plugins: [{ rules: { 'no-ai-coauthors': noAICoauthors } }],
rules: {
'no-ai-coauthors': [2, 'always'],
'type-enum': [
2,
'always',
['feat', 'fix', 'refactor', 'perf', 'docs', 'test', 'build', 'ci', 'chore']
],
// Product names such as MCP, DOM/CSS, and Kiwi retain their casing.
'subject-case': [0],
'scope-case': [0],
'body-max-line-length': [0],
'footer-max-line-length': [0]
},
ignores: [
(message) =>
!hasAICoauthor(message) &&
(/^Release v\d+\.\d+\.\d+$/.test(message.split('\n')[0] ?? '') ||
(process.env.COMMITLINT_PR_TITLE !== '1' && isIgnored(message)))
],
helpUrl: 'https://github.com/open-pencil/open-pencil/blob/master/CONTRIBUTING.md#commit-messages'
} satisfies UserConfig