mirror of
https://github.com/neovim/neovim.git
synced 2026-05-24 05:40:08 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user