From 32698d6d151fb20a47427be2a7bcfa754620b48c Mon Sep 17 00:00:00 2001 From: rjtch Date: Sat, 27 Jan 2024 19:02:47 +0100 Subject: [PATCH] added rules for linter Signed-off-by: rjtch --- .github/workflows/linter.yaml | 2 +- commitlint.config.js | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 commitlint.config.js diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 1431be7..61a448a 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -30,7 +30,7 @@ jobs: fetch-depth: 0 - name: Check Commit Lint with: - configFile: "./.commitlintrc.json" + configFile: "./.commitlint.config.js" uses: wagoid/commitlint-github-action@v5.4.5 lint_check: diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..f21837f --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,37 @@ +module.exports = { + parserPreset: 'conventional-changelog-conventionalcommits', + rules: { + 'body-leading-blank': [1, 'always'], + 'body-max-line-length': [2, 'always', 100], + 'footer-leading-blank': [1, 'always'], + 'footer-max-line-length': [2, 'always', 100], + 'header-max-length': [2, 'always', 100], + 'header-trim': [2, 'always'], + 'subject-case': [ + 2, + 'never', + ['sentence-case', 'start-case', 'pascal-case', 'upper-case'], + ], + 'subject-empty': [2, 'never'], + 'subject-full-stop': [2, 'never', '.'], + 'type-case': [2, 'always', 'lower-case'], + 'type-empty': [2, 'never'], + 'type-enum': [ + 2, + 'never', + [ + 'build', + 'chore', + 'ci', + 'docs', + 'feat', + 'fix', + 'perf', + 'refactor', + 'revert', + 'style', + 'test', + ], + ], + }, +};