mirror of
https://github.com/mendersoftware/mender-server.git
synced 2025-03-14 10:08:46 +00:00
Without a blank line, git cliff cannot understand the type of commit and it ignores the commit. With this change, the commit body must begin with a blank line Ticket: QA-940 Signed-off-by: Roberto Giovanardi <roberto.giovanardi@northern.tech>
49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
const commonScopes = [
|
|
'create-artifact-worker',
|
|
'deployments',
|
|
'deviceauth',
|
|
'deviceconfig',
|
|
'deviceconnect',
|
|
'inventory',
|
|
'iot-manager',
|
|
'reporting',
|
|
'useradm',
|
|
'workflows',
|
|
'gui',
|
|
null
|
|
];
|
|
|
|
module.exports = {
|
|
extends: ['@commitlint/config-conventional'],
|
|
plugins: ['selective-scope'],
|
|
rules: {
|
|
'body-max-line-length': [1, 'always', 100],
|
|
'selective-scope': [
|
|
2,
|
|
'always',
|
|
{
|
|
feat: commonScopes,
|
|
fix: commonScopes,
|
|
test: commonScopes,
|
|
perf: [], // scope is not allowed
|
|
ci: [] // scope is not allowed
|
|
}
|
|
],
|
|
'subject-case': [1, 'always', ['lower-case', 'sentence-case']],
|
|
'signed-off-by': [2, 'always', 'Signed-off-by'],
|
|
'body-leading-blank': [2, 'always'], // body must be preceded by a blank line
|
|
// exit with error if not
|
|
},
|
|
|
|
helpUrl: `
|
|
Commit messages must follow conventional commit format:
|
|
https://www.conventionalcommits.org/en/v1.0.0/#summary
|
|
type(optional-scope): subject
|
|
|
|
[optional body]
|
|
* To bypass pre-commit hooks run 'git commit --no-verify'
|
|
>>> Use "npm run commit" for interactive prompt. <<<
|
|
`
|
|
};
|
|
|