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.
This commit is contained in:
Justin M. Keyes
2026-04-16 09:35:58 -04:00
committed by GitHub
parent 5b0ad4a060
commit 11a1ec7df3
14 changed files with 359 additions and 126 deletions

View File

@@ -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: