diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-11-30 07:31:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-30 07:31:22 +0800 |
commit | 65de1a22c4d94cd8591f90255bcde72e6b385e60 (patch) | |
tree | d65ed0fca530f27e201bcf6270270c2166a4ecef | |
parent | 73691b6c3ded0c97aea0af13abab94b7a93776b0 (diff) | |
download | rneovim-65de1a22c4d94cd8591f90255bcde72e6b385e60.tar.gz rneovim-65de1a22c4d94cd8591f90255bcde72e6b385e60.tar.bz2 rneovim-65de1a22c4d94cd8591f90255bcde72e6b385e60.zip |
ci(lintcommit): fix empty and period check with multiple colons (#26312)
-rw-r--r-- | scripts/lintcommit.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/lintcommit.lua b/scripts/lintcommit.lua index d2c8601c25..a3ad4657e9 100644 --- a/scripts/lintcommit.lua +++ b/scripts/lintcommit.lua @@ -74,7 +74,11 @@ local function validate_commit(commit_message) if after_idx > vim.tbl_count(commit_split) then return [[Commit message does not include colons.]] end - local after_colon = commit_split[after_idx] + local after_colon = '' + while after_idx <= vim.tbl_count(commit_split) do + after_colon = after_colon .. commit_split[after_idx] + after_idx = after_idx + 1 + end -- Check if commit introduces a breaking change. if vim.endswith(before_colon, "!") then @@ -239,11 +243,14 @@ function M._test() ['refactor(): empty scope'] = false, ['ci( ): whitespace as scope'] = false, ['ci: period at end of sentence.'] = false, + ['ci: period: at end of sentence.'] = false, ['ci: Capitalized first word'] = false, ['ci: UPPER_CASE First Word'] = true, ['unknown: using unknown type'] = false, ['feat: foo:bar'] = true, + ['feat: :foo:bar'] = true, ['feat(something): foo:bar'] = true, + ['feat(something): :foo:bar'] = true, ['feat(:grep): read from pipe'] = true, ['feat(:grep/:make): read from pipe'] = true, ['feat(:grep): foo:bar'] = true, |