@casomoltd/tooling 0.25.1 → 0.26.1
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.
- package/commitlint/index.cjs +13 -1
- package/package.json +2 -2
package/commitlint/index.cjs
CHANGED
|
@@ -13,8 +13,20 @@ module.exports = {
|
|
|
13
13
|
// check misses exactly the line this rule exists to catch. (Not
|
|
14
14
|
// `raw`: under `git commit -v` that can carry the whole diff.)
|
|
15
15
|
const fullMessage = `${header}\n${body || ''}\n${footer || ''}`.toLowerCase();
|
|
16
|
+
// `CLAUDE.md` and `.claude/…` are paths in this toolchain, not
|
|
17
|
+
// attribution, and a repo whose instruction file is called CLAUDE.md
|
|
18
|
+
// otherwise cannot write a commit saying which file it changed. That
|
|
19
|
+
// is not hypothetical: it cost a real commit two rejections before
|
|
20
|
+
// the message was reworded to talk around its own filename.
|
|
21
|
+
//
|
|
22
|
+
// Stripped rather than allow-listed, so the scan still sees whatever
|
|
23
|
+
// surrounds them: `Co-Authored-By: Claude` in a message that also
|
|
24
|
+
// edits `.claude/settings.json` is still caught.
|
|
25
|
+
const scanned = fullMessage
|
|
26
|
+
.replace(/[\w./~-]*claude\.md/g, '')
|
|
27
|
+
.replace(/[~.]?\/?\.claude\/[\w./-]*/g, '');
|
|
16
28
|
const forbidden = ['anthropic', 'claude', 'co-authored-by'];
|
|
17
|
-
const found = forbidden.filter((term) =>
|
|
29
|
+
const found = forbidden.filter((term) => scanned.includes(term));
|
|
18
30
|
return [
|
|
19
31
|
found.length === 0,
|
|
20
32
|
`Commit must not mention AI tools: found "${found.join(', ')}"`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@casomoltd/tooling",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"description": "Casomo's shared dev config: ESLint, Prettier, commitlint, knip & jscpd presets and dev CLIs (git hooks, readability, screenshots)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"scripts": {
|
|
23
23
|
"check": "node bin/check-gates.mjs && node bin/verify-pack.mjs && npm run check:private-refs && npm run typecheck && npm run test && npm run lint:md",
|
|
24
24
|
"typecheck": "tsc --noEmit -p hooks/tsconfig.json",
|
|
25
|
-
"test": "node hooks/test.mts && node bin/check-gates.test.mjs",
|
|
25
|
+
"test": "node hooks/test.mts && node bin/check-gates.test.mjs && node commitlint/index.test.mjs",
|
|
26
26
|
"lint:md": "remark --frail --quiet --no-stdout --rc-path bin/skills-lint.config.mjs skills agents docs",
|
|
27
27
|
"build": "echo 'no-op: source-only repo, nothing to build'",
|
|
28
28
|
"prepare": "husky || true",
|