From 11a1ec7df3af48208fb1271907c02ae060172d01 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 16 Apr 2026 09:35:58 -0400 Subject: 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. --- scripts/lintcommit.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts/lintcommit.lua') 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: -- cgit