Re: [ovs-dev] [PATCH 2/3] checkpatch: add suggestions to the spell checker

2023-07-11 Thread Eelco Chaudron



On 7 Jul 2023, at 22:07, Chandan Somani wrote:

> This will be useful for correcting possible spelling
> mistakes with ease. Suggestions limited to 3 at first,
> but configurable in the future.
>
> Signed-off-by: Chandan Somani 
> Acked-by: Aaron Conole 
> ---

This looks good, thank Chandan.

Acked-by: Eelco Chaudron 

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 2/3] checkpatch: add suggestions to the spell checker

2023-07-07 Thread Chandan Somani
This will be useful for correcting possible spelling
mistakes with ease. Suggestions limited to 3 at first,
but configurable in the future.

Signed-off-by: Chandan Somani 
Acked-by: Aaron Conole 
---
 utilities/checkpatch.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index acf9a0102..e5d5029f2 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -412,6 +412,7 @@ def check_spelling(line, comment):
 words = words.replace(':', ' ').split(' ')
 
 flagged_words = []
+num_suggestions = 3
 
 for word in words:
 skip = False
@@ -442,6 +443,8 @@ def check_spelling(line, comment):
 if len(flagged_words) > 0:
 for mistake in flagged_words:
 print_warning("Possible misspelled word: \"%s\"" % mistake)
+print("Did you mean: ",
+  spell_check_dict.suggest(mistake)[:num_suggestions])
 
 return True
 
-- 
2.26.3

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 2/3] checkpatch: add suggestions to the spell checker

2023-06-30 Thread Aaron Conole
Chandan Somani  writes:

> This wil lbe useful for correcting possible spelling
> mistakes with ease. Suggestions limited to 3 at first,
> but configurable in the future
>
> Signed-off-by: Chandan Somani 
> ---

This is a really useful feature!  Thanks!

Acked-by: Aaron Conole 

>  utilities/checkpatch.py | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
> index bc5f696bb..57f7baf46 100755
> --- a/utilities/checkpatch.py
> +++ b/utilities/checkpatch.py
> @@ -412,6 +412,7 @@ def check_spelling(line, comment):
>  words = words.replace(':', ' ').split(' ')
>  
>  flagged_words = []
> +num_suggestions = 3

Just a question, is there a way this can be made configurable?  I can
imagine only wanting more / less.

>  for word in words:
>  skip = False
> @@ -442,6 +443,8 @@ def check_spelling(line, comment):
>  if len(flagged_words > 0):
>  for mistake in flagged_words:
>  print_warning("Possible misspelled word: \"%s\"" % mistake)
> +print("Did you mean: ",
> +  spell_check_dict.suggest(mistake)[:num_suggestions])
>  
>  return True

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 2/3] checkpatch: add suggestions to the spell checker

2023-06-29 Thread Chandan Somani
This wil lbe useful for correcting possible spelling
mistakes with ease. Suggestions limited to 3 at first,
but configurable in the future

Signed-off-by: Chandan Somani 
---
 utilities/checkpatch.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index bc5f696bb..57f7baf46 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -412,6 +412,7 @@ def check_spelling(line, comment):
 words = words.replace(':', ' ').split(' ')
 
 flagged_words = []
+num_suggestions = 3
 
 for word in words:
 skip = False
@@ -442,6 +443,8 @@ def check_spelling(line, comment):
 if len(flagged_words > 0):
 for mistake in flagged_words:
 print_warning("Possible misspelled word: \"%s\"" % mistake)
+print("Did you mean: ",
+  spell_check_dict.suggest(mistake)[:num_suggestions])
 
 return True
 
-- 
2.26.3

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev