mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
ci(lintcommit.lua): replace third-party commitlint #15747
This commit is contained in:
35
.github/workflows/commitlint.config.js
vendored
35
.github/workflows/commitlint.config.js
vendored
@@ -1,35 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
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],
|
|
||||||
'scope-case': [2, 'always', 'lower-case'],
|
|
||||||
'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,
|
|
||||||
'always',
|
|
||||||
[
|
|
||||||
'build',
|
|
||||||
'chore',
|
|
||||||
'ci',
|
|
||||||
'docs',
|
|
||||||
'feat',
|
|
||||||
'fix',
|
|
||||||
'perf',
|
|
||||||
'refactor',
|
|
||||||
'revert',
|
|
||||||
'test',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
27
.github/workflows/commitlint.config_patch.js
vendored
27
.github/workflows/commitlint.config_patch.js
vendored
@@ -1,27 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
parserPreset: {
|
|
||||||
parserOpts: { headerPattern: /^([^\(\):]*)(?:\((.*)\))?!?:(.*)$/ }
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
'body-leading-blank': [1, 'always'],
|
|
||||||
'body-max-line-length': [2, 'always', 100],
|
|
||||||
'footer-max-line-length': [2, 'always', 100],
|
|
||||||
'scope-case': [2, 'always', 'lower-case'],
|
|
||||||
'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,
|
|
||||||
'always',
|
|
||||||
[
|
|
||||||
'vim-patch',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
12
.github/workflows/commitlint.yml
vendored
12
.github/workflows/commitlint.yml
vendored
@@ -9,10 +9,8 @@ jobs:
|
|||||||
- uses: actions/checkout@v2.3.1
|
- uses: actions/checkout@v2.3.1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- run: npm install --save-dev @commitlint/cli
|
- uses: rhysd/action-setup-vim@v1
|
||||||
- run: |
|
with:
|
||||||
if [[ "$(gh pr view ${{ github.event.pull_request.number }} --json commits --jq '.[][0].messageHeadline')" == vim-patch* ]];then
|
neovim: true
|
||||||
npx commitlint --from HEAD~1 --to HEAD --verbose --help-url https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#commit-messages --config .github/workflows/commitlint.config_patch.js
|
- run: gh pr checkout ${{ github.event.pull_request.number }}
|
||||||
else
|
- run: nvim --clean -es +"lua require('scripts.lintcommit').main({trace=true})"
|
||||||
npx commitlint --from HEAD~1 --to HEAD --verbose --help-url https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#commit-messages --config .github/workflows/commitlint.config.js
|
|
||||||
fi
|
|
||||||
|
@@ -91,7 +91,7 @@ local function validate_commit(commit_message)
|
|||||||
|
|
||||||
-- Check that description doesn't end with a period
|
-- Check that description doesn't end with a period
|
||||||
if vim.endswith(after_colon, ".") then
|
if vim.endswith(after_colon, ".") then
|
||||||
return [[Description ends with a period (\".\").]]
|
return [[Description ends with a period (".").]]
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check that description has exactly one whitespace after colon, followed by
|
-- Check that description has exactly one whitespace after colon, followed by
|
||||||
|
Reference in New Issue
Block a user