Expected Behavior
Would it be okay to allow the subject-case rule handle not only latin but any other language alphabet?
Current Behavior
Currently, the subject-case rule skips validation if message doesn't start with a latin alphabet character (only a to z with case irrelevant, as of now).
It became like that 5 years ago with the following change made — @commitlint/rules/src/subject-case.ts#L14.
Affected packages
Possible Solution
The solution, as I see it, would only require to change the RegExp that is used to filter invalid subject messages.
So, change what is used now (which only includes latin alphabet):
to a pattern with unicode support:
subject.match(/^\p{L}/ui)
where \p{L} means any kind of letter from any language and the u flag enables it.
Context
Basically, if a commit subject is written in non-English language then subject-case rule is just skipped.
This feature would benefit someone who (for one reason or another) writes commit messages (or, rather, subject) using different language than English but still wants to follow the commit convention.
Expected Behavior
Would it be okay to allow the
subject-caserule handle not only latin but any other language alphabet?Current Behavior
Currently, the
subject-caserule skips validation if message doesn't start with a latin alphabet character (onlyatozwith case irrelevant, as of now).Affected packages
Possible Solution
The solution, as I see it, would only require to change the RegExp that is used to filter invalid subject messages.
So, change what is used now (which only includes latin alphabet):
to a pattern with unicode support:
where
\p{L}meansany kind of letter from any languageand theuflag enables it.Context
Basically, if a commit
subjectis written in non-English language thensubject-caserule is just skipped.This feature would benefit someone who (for one reason or another) writes commit messages (or, rather,
subject) using different language than English but still wants to follow the commit convention.