diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-04-16 09:35:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-16 09:35:58 -0400 |
| commit | 11a1ec7df3af48208fb1271907c02ae060172d01 (patch) | |
| tree | 7af73d039a9c21c996a5c8214406c9355bade27b /scripts | |
| parent | 5b0ad4a0607498616b984c63ae1a6903cb835c66 (diff) | |
test: lint naming conventions #39117
Problem:
Naming conventions are not automatically checked.
Solution:
Add a check to the doc generator. Eventually we should extract this
somehow, but that will require refactoring the doc generator...
Note: this also checks non-public functions, basically anything that
passes through `gen_eval_files.lua` and `gen_vimdoc.lua`. And that's
a good thing.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/lintcommit.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/lintcommit.lua b/scripts/lintcommit.lua index c04f2a0c55..4b78b8a9f0 100644 --- a/scripts/lintcommit.lua +++ b/scripts/lintcommit.lua @@ -13,6 +13,9 @@ local M = {} local _trace = false +local allowed_types = + { 'build', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'test', 'vim-patch' } + -- Print message local function p(s) vim.cmd('set verbose=1') @@ -88,8 +91,6 @@ local function validate_commit(commit_message) -- Check if type is correct local type = vim.split(before_colon, '(', { plain = true })[1] - local allowed_types = - { 'build', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'test', 'vim-patch' } if not vim.tbl_contains(allowed_types, type) then return string.format( [[Invalid commit type "%s". Allowed types are: |
