From c1f8465607be0ce12f944f2d286a8935c89b5ff8 Mon Sep 17 00:00:00 2001 From: Mathias Rasmussen Date: Thu, 21 Jan 2021 03:29:34 +0100 Subject: [PATCH] build: Commitlint and changelog scripts --- .github/workflows/commitlint.config.js | 19 +++++++++++++++---- Makefile | 4 ++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/commitlint.config.js b/.github/workflows/commitlint.config.js index 758dad0..c228c7c 100644 --- a/.github/workflows/commitlint.config.js +++ b/.github/workflows/commitlint.config.js @@ -1,8 +1,19 @@ module.exports = { - extends: ['@commitlint/config-conventional'], + parserPreset: 'conventional-changelog-conventionalcommits', rules: { - 'subject-case': [2, 'always', ['sentence-case']], 'body-leading-blank': [2, 'always'], - 'footer-leading-blank': [2, 'always'] - } + 'body-max-line-length': [2, 'always', 100], + 'footer-leading-blank': [2, 'always'], + 'footer-max-line-length': [2, 'always', 100], + 'header-max-length': [2, 'always', 100], + 'scope-case': [2, 'always', 'lower-case'], + 'subject-case': [2, 'always', ['sentence-case']], + 'subject-empty': [2, 'never'], + 'subject-full-stop': [2, 'never', '.'], + 'type-case': [2, 'always', 'lower-case'], + 'type-empty': [2, 'never'], + 'type-enum': [2, 'always', + ['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test'] + ], + }, }; diff --git a/Makefile b/Makefile index 6fac4a1..07aa06c 100644 --- a/Makefile +++ b/Makefile @@ -110,6 +110,10 @@ $(OUTPUT_DIR_HEX)/%.hex : $(OUTPUT_DIR)/%.OMF @echo "OHX : generating hex file $@" @$(OX51) "$<" "HEXFILE ($@)" >> $(LOG) 2>&1 || (tail $(LOG); exit 1) +changelog: + @npx -q commitlint --config .github/workflows/commitlint.config.js --from v0.1.0 + @npx -q mathiasvr/generate-changelog --exclude build,chore,ci,docs,refactor,style,other + help: @echo "" @echo "usage examples:"