diff options
author | Ankit Goel <ankitgoel616@gmail.com> | 2023-03-22 02:57:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-22 09:57:23 +0700 |
commit | a7b537c7a4e5b6114cd75df5178199f4449c6480 (patch) | |
tree | f62353948e463fdfaaf69ad91f0b6246efe7b434 | |
parent | 434f3d6a039401c856337926a788cd11d9dad027 (diff) | |
download | rneovim-a7b537c7a4e5b6114cd75df5178199f4449c6480.tar.gz rneovim-a7b537c7a4e5b6114cd75df5178199f4449c6480.tar.bz2 rneovim-a7b537c7a4e5b6114cd75df5178199f4449c6480.zip |
ci(lintcommit): allow colon in commit message scope
Close #21464
-rw-r--r-- | scripts/lintcommit.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/lintcommit.lua b/scripts/lintcommit.lua index 7e08ca4ea0..92b07c4f73 100644 --- a/scripts/lintcommit.lua +++ b/scripts/lintcommit.lua @@ -69,7 +69,7 @@ local function validate_commit(commit_message) end local before_colon = commit_split[1] - local after_colon = commit_split[2] + local after_colon = commit_split[#commit_split] -- Check if commit introduces a breaking change. if vim.endswith(before_colon, "!") then @@ -90,7 +90,7 @@ local function validate_commit(commit_message) -- Check if scope is appropriate if before_colon:match("%(") then - local scope = vim.trim(before_colon:match("%((.*)%)")) + local scope = vim.trim(commit_message:match("%((.-)%)")) if scope == '' then return [[Scope can't be empty]] @@ -234,6 +234,7 @@ function M._test() ['ci: Capitalized first word'] = false, ['ci: UPPER_CASE First Word'] = true, ['unknown: using unknown type'] = false, + ['feat(:grep): read from pipe'] = true, ['ci: you\'re saying this commit message just goes on and on and on and on and on and on for way too long?'] = false, } |