mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
feat(lintcommit): remove "chore", add "dist" #18594
"chore" is never necessary, choose "fix" or "feat" if nothing else applies.
This commit is contained in:
parent
54b5222fbb
commit
b239db3cb5
@ -92,7 +92,7 @@ the VCS/git logs more valuable. The general structure of a commit message is:
|
|||||||
```
|
```
|
||||||
|
|
||||||
- Prefix the commit subject with one of these [_types_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
|
- Prefix the commit subject with one of these [_types_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
|
||||||
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`, `chore`
|
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`, `dist`
|
||||||
- You can **ignore this for "fixup" commits** or any commits you expect to be squashed.
|
- You can **ignore this for "fixup" commits** or any commits you expect to be squashed.
|
||||||
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, …
|
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, …
|
||||||
- _Description_ shouldn't start with a capital letter or end in a period.
|
- _Description_ shouldn't start with a capital letter or end in a period.
|
||||||
|
@ -78,7 +78,7 @@ local function validate_commit(commit_message)
|
|||||||
|
|
||||||
-- Check if type is correct
|
-- Check if type is correct
|
||||||
local type = vim.split(before_colon, "%(")[1]
|
local type = vim.split(before_colon, "%(")[1]
|
||||||
local allowed_types = {'build', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'test', 'chore', 'vim-patch'}
|
local allowed_types = {'build', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'test', 'dist', 'vim-patch'}
|
||||||
if not vim.tbl_contains(allowed_types, type) then
|
if not vim.tbl_contains(allowed_types, type) then
|
||||||
return string.format(
|
return string.format(
|
||||||
'Invalid commit type "%s". Allowed types are:\n %s',
|
'Invalid commit type "%s". Allowed types are:\n %s',
|
||||||
@ -181,7 +181,7 @@ function M._test()
|
|||||||
['refactor: normal message'] = true,
|
['refactor: normal message'] = true,
|
||||||
['revert: normal message'] = true,
|
['revert: normal message'] = true,
|
||||||
['test: normal message'] = true,
|
['test: normal message'] = true,
|
||||||
['chore: normal message'] = true,
|
['dist: normal message'] = true,
|
||||||
['ci(window): message with scope'] = true,
|
['ci(window): message with scope'] = true,
|
||||||
['ci!: message with breaking change'] = true,
|
['ci!: message with breaking change'] = true,
|
||||||
['ci(tui)!: message with scope and breaking change'] = true,
|
['ci(tui)!: message with scope and breaking change'] = true,
|
||||||
@ -205,10 +205,10 @@ function M._test()
|
|||||||
['ci :extra space before colon'] = false,
|
['ci :extra space before colon'] = false,
|
||||||
['refactor(): empty scope'] = false,
|
['refactor(): empty scope'] = false,
|
||||||
['ci( ): whitespace as scope'] = false,
|
['ci( ): whitespace as scope'] = false,
|
||||||
['chore: period at end of sentence.'] = false,
|
['ci: period at end of sentence.'] = false,
|
||||||
['ci: Starting sentence capitalized'] = false,
|
['ci: Starting sentence capitalized'] = false,
|
||||||
['unknown: using unknown type'] = false,
|
['unknown: using unknown type'] = false,
|
||||||
['chore: you\'re saying this commit message just goes on and on and on and on and on and on for way too long?'] = false,
|
['ci: you\'re saying this commit message just goes on and on and on and on and on and on for way too long?'] = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
local failed = 0
|
local failed = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user