diff mbox series

[ovs-dev,v2,1/3] checkpatch: reorganize flagged words using a list

Message ID 20230707200758.45032-1-csomani@redhat.com
State Accepted
Commit d25c6bd8df37e50cac9aa1c18365bbc91cde3811
Headers show
Series [ovs-dev,v2,1/3] checkpatch: reorganize flagged words using a list | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Chandan Somani July 7, 2023, 8:07 p.m. UTC
Single out flagged words and allow for more useful
details, like spelling suggestions. Fixed syntax
error from v1

Signed-off-by: Chandan Somani <csomani@redhat.com>
---
 utilities/checkpatch.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Eelco Chaudron July 11, 2023, 7:09 a.m. UTC | #1
On 7 Jul 2023, at 22:07, Chandan Somani wrote:

> Single out flagged words and allow for more useful
> details, like spelling suggestions. Fixed syntax
> error from v1
>
> Signed-off-by: Chandan Somani <csomani@redhat.com>

Hi Chandan,

Thanks for the patch! I think it looks good, however some small comments on the message format.

The version information should not be part of your commit message but should be moved down (see example below). In addition, your patch subject should start with a capital and end with a dot:

  ‘checkpatch: Reorganize flagged words using a list.’

Don’t worry about it for this series. I will fix it on commit.

Acked-by: Eelco Chaudron <echaudro@redhat.com>

> ---

v2: Fixed syntax error in length comparison.


>  utilities/checkpatch.py | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
> index 64f0efeb4..acf9a0102 100755
> --- a/utilities/checkpatch.py
> +++ b/utilities/checkpatch.py
> @@ -411,6 +411,8 @@ def check_spelling(line, comment):
>      words = filter_comments(line, True) if comment else line
>      words = words.replace(':', ' ').split(' ')
>
> +    flagged_words = []
> +
>      for word in words:
>          skip = False
>          strword = re.subn(r'\W+', '', word)[0].replace(',', '')
> @@ -435,9 +437,13 @@ def check_spelling(line, comment):
>                  skip = True
>
>              if not skip:
> -                print_warning("Check for spelling mistakes (e.g. \"%s\")"
> -                              % strword)
> -                return True
> +                flagged_words.append(strword)
> +
> +    if len(flagged_words) > 0:
> +        for mistake in flagged_words:
> +            print_warning("Possible misspelled word: \"%s\"" % mistake)
> +
> +        return True
>
>      return False
>
> -- 
> 2.26.3
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Aaron Conole July 11, 2023, 8:39 p.m. UTC | #2
Chandan Somani <csomani@redhat.com> writes:

> Single out flagged words and allow for more useful
> details, like spelling suggestions. Fixed syntax
> error from v1
>
> Signed-off-by: Chandan Somani <csomani@redhat.com>
> ---

Thanks!

Acked-by: Aaron Conole <aconole@redhat.com>

>  utilities/checkpatch.py | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
> index 64f0efeb4..acf9a0102 100755
> --- a/utilities/checkpatch.py
> +++ b/utilities/checkpatch.py
> @@ -411,6 +411,8 @@ def check_spelling(line, comment):
>      words = filter_comments(line, True) if comment else line
>      words = words.replace(':', ' ').split(' ')
>  
> +    flagged_words = []
> +
>      for word in words:
>          skip = False
>          strword = re.subn(r'\W+', '', word)[0].replace(',', '')
> @@ -435,9 +437,13 @@ def check_spelling(line, comment):
>                  skip = True
>  
>              if not skip:
> -                print_warning("Check for spelling mistakes (e.g. \"%s\")"
> -                              % strword)
> -                return True
> +                flagged_words.append(strword)
> +
> +    if len(flagged_words) > 0:
> +        for mistake in flagged_words:
> +            print_warning("Possible misspelled word: \"%s\"" % mistake)
> +
> +        return True
>  
>      return False
diff mbox series

Patch

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 64f0efeb4..acf9a0102 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -411,6 +411,8 @@  def check_spelling(line, comment):
     words = filter_comments(line, True) if comment else line
     words = words.replace(':', ' ').split(' ')
 
+    flagged_words = []
+
     for word in words:
         skip = False
         strword = re.subn(r'\W+', '', word)[0].replace(',', '')
@@ -435,9 +437,13 @@  def check_spelling(line, comment):
                 skip = True
 
             if not skip:
-                print_warning("Check for spelling mistakes (e.g. \"%s\")"
-                              % strword)
-                return True
+                flagged_words.append(strword)
+
+    if len(flagged_words) > 0:
+        for mistake in flagged_words:
+            print_warning("Possible misspelled word: \"%s\"" % mistake)
+
+        return True
 
     return False