aboutsummaryrefslogtreecommitdiff
path: root/scripts/lintcommit.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 18:49:30 -0700
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 18:49:30 -0700
commite70fdd00f1cd96c364fe894af61ee5947991414e (patch)
treebde3942d3b01c891166bd02da164797b140f7055 /scripts/lintcommit.lua
parent0bd3cd90d902a1419db129427980ad7af1650d50 (diff)
parent62dff439479315558cd08dedbca61be5fafcc938 (diff)
downloadrneovim-e70fdd00f1cd96c364fe894af61ee5947991414e.tar.gz
rneovim-e70fdd00f1cd96c364fe894af61ee5947991414e.tar.bz2
rneovim-e70fdd00f1cd96c364fe894af61ee5947991414e.zip
Merge remote-tracking branch 'upstream/master' into fix_20726fix_20726
Diffstat (limited to 'scripts/lintcommit.lua')
-rw-r--r--scripts/lintcommit.lua9
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,