Based on conventional commit specification, check if commit messages comply with the given rules.
Place custom configuration files in the project root directory. For configuration file search priority, refer to the official documentation
When this configuration is not added, the following default configuration will be used:
# Default .commitlintrc.yml configuration
extends:
- "@commitlint/config-conventional"
The following plugins are supported by default:
Consistent with open source community standards, see https://www.conventionalcommits.org/
# The plugin uses git command internally to get commit messages, no need to pass commit messages
main:
pull_request:
- stages:
- name: commitlint
image: cnbcool/commitlint
#.commitlintrc.yml
extends:
- "@commitlint/config-conventional"
rules:
#Allow Chinese
subject-case: [0]
Use the following configuration to require issue numbers starting with # in commit messages.
#.commitlintrc.yml
extends:
- "@commitlint/config-conventional"
parserPreset:
parserOpts:
# issues start with #
issuePrefixes: ["#"]
rules:
#Allow Chinese
subject-case: [0]
#Must have issue references
references-empty: [2, 'never']
#.commitlintrc.yml
extends:
- "@commitlint/config-conventional"
plugins:
- references
parserPreset:
parserOpts:
issuePrefixes: ["#", '--bug=']
rules:
#Allow Chinese
subject-case: [0]
# feat and fix must have issue references
references-empty-enum: [2, "never", ["fix", "feat"]]