diff mbox series

[ovs-dev,2/3] checkpatch: Skip words containing numbers.

Message ID 20191208194234.12061-3-i.maximets@ovn.org
State Accepted
Delegated to: Ilya Maximets
Headers show
Series checkpatch: Spell checker enhancements. | expand

Commit Message

Ilya Maximets Dec. 8, 2019, 7:42 p.m. UTC
Words like 'br0' are common and usually references some code or
database objects that should not be targets for spell checking.
So, it's better to skip all the words that has digits inside instead
of ones that starts with numbers.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 utilities/checkpatch.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

William Tu Dec. 9, 2019, 7:19 p.m. UTC | #1
On Sun, Dec 08, 2019 at 08:42:33PM +0100, Ilya Maximets wrote:
> Words like 'br0' are common and usually references some code or
> database objects that should not be targets for spell checking.
> So, it's better to skip all the words that has digits inside instead
> of ones that starts with numbers.
> 
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: William Tu <u9012063@gmail.com>

> ---
>  utilities/checkpatch.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
> index 6d95b0e2f..1b14ca5d5 100755
> --- a/utilities/checkpatch.py
> +++ b/utilities/checkpatch.py
> @@ -396,8 +396,8 @@ def check_comment_spelling(line):
>                                       strword[1:].islower()):
>                  skip = True
>  
> -            # skip words that start with numbers
> -            if strword.startswith(tuple('0123456789')):
> +            # skip words containing numbers
> +            if any(check_char.isdigit() for check_char in strword):
>                  skip = True
>  
>              if not skip:
> -- 
> 2.17.1
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox series

Patch

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 6d95b0e2f..1b14ca5d5 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -396,8 +396,8 @@  def check_comment_spelling(line):
                                      strword[1:].islower()):
                 skip = True
 
-            # skip words that start with numbers
-            if strword.startswith(tuple('0123456789')):
+            # skip words containing numbers
+            if any(check_char.isdigit() for check_char in strword):
                 skip = True
 
             if not skip: