From 45bf8bf477831cc7242f53f2ce2d063e0fffbf29 Mon Sep 17 00:00:00 2001 From: kj-podonos Date: Wed, 17 Jun 2026 19:42:32 +0900 Subject: [PATCH] ci(commitlint): ignore dependabot bump commits Migrate .commitlintrc.json to commitlint.config.cjs so we can use a function-based `ignores` rule (not expressible in JSON). Ignore Dependabot's default `Bump from to ` subject, which has no Conventional Commits type prefix and is produced for indirect (transitive) dependency updates even though .github/dependabot.yml sets a `chore` prefix. That mismatch failed the commitlint check on PR #50 (cryptography 48.0.1). Co-Authored-By: Claude Opus 4.8 (1M context) --- .commitlintrc.json | 6 ------ commitlint.config.cjs | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) delete mode 100644 .commitlintrc.json create mode 100644 commitlint.config.cjs diff --git a/.commitlintrc.json b/.commitlintrc.json deleted file mode 100644 index a2f7234..0000000 --- a/.commitlintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["@commitlint/config-conventional"], - "rules": { - "body-max-line-length": [2, "always", 120] - } -} diff --git a/commitlint.config.cjs b/commitlint.config.cjs new file mode 100644 index 0000000..5a0f0e5 --- /dev/null +++ b/commitlint.config.cjs @@ -0,0 +1,18 @@ +// Commitlint configuration. +// +// Migrated from .commitlintrc.json so we can use a function-based `ignores` +// rule (not expressible in JSON). Dependabot's default commit subject for some +// updates is `Bump from to ` with no Conventional Commits type +// prefix — this happens for indirect/transitive dependencies even when +// .github/dependabot.yml sets `commit-message.prefix`. Ignore that format so +// those automated PRs don't fail the commitlint check. +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + 'body-max-line-length': [2, 'always', 120], + }, + // `ignores` is additive: built-in defaultIgnores (merge/revert/fixup/squash) + // still apply. Kept explicit so the additive-vs-replace semantics are obvious. + defaultIgnores: true, + ignores: [(message) => /^Bump .+ from .+ to .+/i.test(message)], +};