[ovs-dev] [PATCH 1/3] checkpatch: Allow common abbreviations for spell checking.

William Tu u9012063 at gmail.com
Mon Dec 9 19:19:12 UTC 2019


On Sun, Dec 08, 2019 at 08:42:32PM +0100, Ilya Maximets wrote:
> Abbreviations of Latin expressions like 'i.e.' or 'e.g.' are common
> and known by the dictionary.  However, our spell checker is not able
> to recognize them because it strips dots out of them.  To avoid this
> issue we could pass non-stripped version of the word to the dictionary
> checker too.
> 
> Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
LGTM,
Acked-by: William Tu <u9012063 at gmail.com>

> ---
>  utilities/checkpatch.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
> index 9b79d268f..6d95b0e2f 100755
> --- a/utilities/checkpatch.py
> +++ b/utilities/checkpatch.py
> @@ -380,7 +380,9 @@ def check_comment_spelling(line):
>      for word in comment_words:
>          skip = False
>          strword = re.subn(r'\W+', '', word)[0].replace(',', '')
> -        if len(strword) and not spell_check_dict.check(strword.lower()):
> +        if (len(strword)
> +                and not spell_check_dict.check(strword.lower())
> +                and not spell_check_dict.check(word.lower())):
>              if any([check_char in word
>                      for check_char in ['=', '(', '-', '_', '/', '\'']]):
>                  skip = True
> -- 
> 2.17.1
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev


More information about the dev mailing list