From 41c63b1e7f36c88ea3bc10a587ab075cef30bf81 Mon Sep 17 00:00:00 2001 From: Jason Baker Date: Sat, 27 Jul 2024 20:57:09 +0000 Subject: [PATCH] ci: add custom commitlint config --- commitlint.config.js | 62 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 commitlint.config.js diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..ea14678 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,62 @@ +const Configuration = { + /* + * Resolve and load @commitlint/config-conventional from node_modules. + * Referenced packages must be installed + */ + extends: ['@commitlint/config-conventional'], + /* + * Resolve and load conventional-changelog-atom from node_modules. + * Referenced packages must be installed + */ + parserPreset: 'conventional-changelog-atom', + /* + * Resolve and load @commitlint/format from node_modules. + * Referenced package must be installed + */ + formatter: '@commitlint/format', + /* + * Any rules defined here will override rules from @commitlint/config-conventional + */ + rules: { + 'footer-max-line-length': [ + RuleConfigSeverity.Warning, + 'always', + 100, + ], + }, + /* + * Array of functions that return true if commitlint should ignore the given message. + * Given array is merged with predefined functions, which consist of matchers like: + * + * - 'Merge pull request', 'Merge X into Y' or 'Merge branch X' + * - 'Revert X' + * - 'v1.2.3' (ie semver matcher) + * - 'Automatic merge X' or 'Auto-merged X into Y' + * + * To see full list, check https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/is-ignored/src/defaults.ts. + * To disable those ignores and run rules always, set `defaultIgnores: false` as shown below. + */ + ignores: [(commit) => commit === ''], + /* + * Whether commitlint uses the default ignore rules, see the description above. + */ + defaultIgnores: true, + /* + * Custom URL to show upon failure + */ + helpUrl: + 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint', + /* + * Custom prompt configs + */ + prompt: { + messages: {}, + questions: { + type: { + description: 'please input type:', + }, + }, + }, +}; + +export default Configuration; \ No newline at end of file