From 5fbfb543e80e0cc08177eae8a596810b7287bd66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Apr 2024 09:29:37 +0000 Subject: [PATCH 1/2] chore(deps): bump wagoid/commitlint-github-action from 5.4.5 to 6.0.1 Bumps [wagoid/commitlint-github-action](https://github.com/wagoid/commitlint-github-action) from 5.4.5 to 6.0.1. - [Changelog](https://github.com/wagoid/commitlint-github-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/wagoid/commitlint-github-action/compare/5ce82f5d814d4010519d15f0552aec4f17a1e1fe...7f0a61df502599e1f1f50880aaa7ec1e2c0592f2) --- updated-dependencies: - dependency-name: wagoid/commitlint-github-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 184d18f..50ea55b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 with: fetch-depth: 0 - - uses: wagoid/commitlint-github-action@5ce82f5d814d4010519d15f0552aec4f17a1e1fe # v5.4.5 + - uses: wagoid/commitlint-github-action@7f0a61df502599e1f1f50880aaa7ec1e2c0592f2 # v6.0.1 with: configFile: .github/commitlint.config.js lint-actions: From f9bbe6933cd6b873c6c41e5d0cc0c0926bf3680e Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Fri, 12 Apr 2024 17:33:38 +0800 Subject: [PATCH 2/2] chore: update commitlint config for v6.x --- .github/commitlint.config.js | 15 --------------- .github/commitlint.config.mjs | 29 +++++++++++++++++++++++++++++ .github/workflows/lint.yaml | 2 +- 3 files changed, 30 insertions(+), 16 deletions(-) delete mode 100644 .github/commitlint.config.js create mode 100644 .github/commitlint.config.mjs diff --git a/.github/commitlint.config.js b/.github/commitlint.config.js deleted file mode 100644 index 252a9ad..0000000 --- a/.github/commitlint.config.js +++ /dev/null @@ -1,15 +0,0 @@ -const Configuration = { - /* - * Resolve and load @commitlint/config-conventional from node_modules. - * Referenced packages must be installed - */ - extends: ['@commitlint/config-conventional'], - /* - * Any rules defined here will override rules from @commitlint/config-conventional - */ - rules: { - 'body-max-line-length': [1, 'always', 80], - }, -}; - -module.exports = Configuration; diff --git a/.github/commitlint.config.mjs b/.github/commitlint.config.mjs new file mode 100644 index 0000000..51b1c33 --- /dev/null +++ b/.github/commitlint.config.mjs @@ -0,0 +1,29 @@ +/* Taken from: https://github.com/wagoid/commitlint-github-action/blob/7f0a61df502599e1f1f50880aaa7ec1e2c0592f2/commitlint.config.mjs */ +/* eslint-disable import/no-extraneous-dependencies */ +import { maxLineLength } from '@commitlint/ensure' + +const bodyMaxLineLength = 100 + +const validateBodyMaxLengthIgnoringDeps = (parsedCommit) => { + const { type, scope, body } = parsedCommit + const isDepsCommit = + type === 'chore' && (scope === 'deps' || scope === 'deps-dev') + + return [ + isDepsCommit || !body || maxLineLength(body, bodyMaxLineLength), + `body's lines must not be longer than ${bodyMaxLineLength}`, + ] +} + +export default { + extends: ['@commitlint/config-conventional'], + plugins: ['commitlint-plugin-function-rules'], + rules: { + 'body-max-line-length': [0], + 'function-rules/body-max-line-length': [ + 2, + 'always', + validateBodyMaxLengthIgnoringDeps, + ], + }, +} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 50ea55b..bab6de5 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -28,7 +28,7 @@ jobs: fetch-depth: 0 - uses: wagoid/commitlint-github-action@7f0a61df502599e1f1f50880aaa7ec1e2c0592f2 # v6.0.1 with: - configFile: .github/commitlint.config.js + configFile: .github/commitlint.config.mjs lint-actions: permissions: contents: read