fix(lintcommit): capitalized description #22282

Problem:
The "Capitalized" check should only check the first word of a description.

Solution:
Specify "^".
This commit is contained in:
Justin M. Keyes 2023-02-16 09:43:05 -05:00 committed by GitHub
parent d34c64e342
commit 5420bf9998
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,8 +129,8 @@ local function validate_commit(commit_message)
end
-- Allow lowercase or ALL_UPPER but not Titlecase.
if after_colon:match(' *%u%l') then
return [[Description should not be Capitalized.]]
if after_colon:match('^ *%u%l') then
return [[Description first word should not be Capitalized.]]
end
-- Check that description isn't just whitespaces
@ -232,7 +232,7 @@ function M._test()
['ci( ): whitespace as scope'] = false,
['ci: period at end of sentence.'] = false,
['ci: Capitalized first word'] = false,
['ci: UPPER_CASE first word'] = true,
['ci: UPPER_CASE First Word'] = true,
['unknown: using unknown type'] = false,
['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,
}