Re: [ovs-dev] [PATCH v2 3/3] checkpatch: print subject field if misspelled or missing

2023-07-12 Thread Eelco Chaudron


On 11 Jul 2023, at 22:10, Chandan Somani wrote:

> On Tue, Jul 11, 2023 at 12:38 AM Eelco Chaudron  wrote:
>
>>
>>
>> On 7 Jul 2023, at 22:07, Chandan Somani wrote:
>>
>>> This narrows down spelling errors that are in the commit
>>> subject. In v2, it also provides a subject if the subject
>>> line is missing. The provisional subject is the name of the
>>> patch file, which should provide some context about the patch.
>>>
>>> Signed-off-by: Chandan Somani 
>>
>> Hi Chandan,
>>
>> Thanks for the patch! The robot found a problem, with a trailing white
>> space.
>>
>> However I can fix this at commit time, also one small change below. Let me
>> know if you agree and will fix this up during commit.
>>
>>Agreed, thanks.

Thanks for the series, and it’s applied to master.

Cheers,

Eelco

>> In addition, would it be possible to send an additional patch(series) to
>> also do this on git-based patches, i.e. if you do something like
>> ‘checkapatch.py -S -2’?
>> Maybe there should be an error if the subject is missing, independent if
>> spellcheck is enabled or not?
>>
>>   Yes, I'll work on this.
>
>>
>> Cheers,
>>
>> Eelco
>>
>>
>>> ---
>>>  utilities/checkpatch.py | 8 
>>>  1 file changed, 8 insertions(+)
>>>
>>> diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
>>> index e5d5029f2..f34e4bf2a 100755
>>> --- a/utilities/checkpatch.py
>>> +++ b/utilities/checkpatch.py
>>> @@ -1024,6 +1024,14 @@ def ovs_checkpatch_file(filename):
>>>  result = ovs_checkpatch_parse(part.get_payload(decode=False),
>> filename,
>>>mail.get('Author', mail['From']),
>>>mail['Commit'])
>>> +if spellcheck:
>>> +if not mail['Subject'].strip():
>>> +mail.replace_header('Subject', sys.argv[-1])
>>> +print("Subject missing! Your provisional subject is",
>>> +  mail['Subject'])
>>
>> If the subject is missing from the patch it would error out.
>> What about the following:
>>
>> +if spellcheck:
>> +if not mail['Subject'] or not mail['Subject'].strip():
>> +if mail['Subject']:
>> +mail.replace_header('Subject', sys.argv[-1])
>> +else:
>> +mail.add_header('Subject', sys.argv[-1])
>> +
>> +print("Subject missing! Your provisional subject is",
>> +  mail['Subject'])
>> +
>> +if check_spelling(mail['Subject'], False):
>> +print("Subject: %s" % mail['Subject'])
>> +
>>
>>
>>> +if check_spelling(mail['Subject'], False):
>>> +print("Subject: %s" % mail['Subject'])
>>> +
>>>  ovs_checkpatch_print_result()
>>>  return result
>>>
>>> --
>>> 2.26.3
>>>
>>> ___
>>> dev mailing list
>>> d...@openvswitch.org
>>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>>
>>

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


Re: [ovs-dev] [PATCH v2 3/3] checkpatch: print subject field if misspelled or missing

2023-07-11 Thread Aaron Conole
Eelco Chaudron  writes:

> On 7 Jul 2023, at 22:07, Chandan Somani wrote:
>
>> This narrows down spelling errors that are in the commit
>> subject. In v2, it also provides a subject if the subject
>> line is missing. The provisional subject is the name of the
>> patch file, which should provide some context about the patch.
>>
>> Signed-off-by: Chandan Somani 
>
> Hi Chandan,
>
> Thanks for the patch! The robot found a problem, with a trailing white space.
>
> However I can fix this at commit time, also one small change
> below. Let me know if you agree and will fix this up during commit.
>
> In addition, would it be possible to send an additional patch(series)
> to also do this on git-based patches, i.e. if you do something like
> ‘checkapatch.py -S -2’?
> Maybe there should be an error if the subject is missing, independent if 
> spellcheck is enabled or not?
>
>
> Cheers,
>
> Eelco
>
>
>> ---
>>  utilities/checkpatch.py | 8 
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
>> index e5d5029f2..f34e4bf2a 100755
>> --- a/utilities/checkpatch.py
>> +++ b/utilities/checkpatch.py
>> @@ -1024,6 +1024,14 @@ def ovs_checkpatch_file(filename):
>>  result = ovs_checkpatch_parse(part.get_payload(decode=False), filename,
>>mail.get('Author', mail['From']),
>>mail['Commit'])
>> +if spellcheck:
>> +if not mail['Subject'].strip():
>> +mail.replace_header('Subject', sys.argv[-1])
>> +print("Subject missing! Your provisional subject is",
>> +  mail['Subject'])
>
> If the subject is missing from the patch it would error out.
> What about the following:
>
> +if spellcheck:
> +if not mail['Subject'] or not mail['Subject'].strip():
> +if mail['Subject']:
> +mail.replace_header('Subject', sys.argv[-1])
> +else:
> +mail.add_header('Subject', sys.argv[-1])
> +
> +print("Subject missing! Your provisional subject is",
> +  mail['Subject'])
> +
> +if check_spelling(mail['Subject'], False):
> +print("Subject: %s" % mail['Subject'])
> +

With the block above, and whitespace changes:

Acked-by: Aaron Conole 

>> +if check_spelling(mail['Subject'], False):
>> +print("Subject: %s" % mail['Subject'])
>> +
>>  ovs_checkpatch_print_result()
>>  return result
>>
>> -- 
>> 2.26.3
>>
>> ___
>> dev mailing list
>> d...@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

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


Re: [ovs-dev] [PATCH v2 3/3] checkpatch: print subject field if misspelled or missing

2023-07-11 Thread Chandan Somani
On Tue, Jul 11, 2023 at 12:38 AM Eelco Chaudron  wrote:

>
>
> On 7 Jul 2023, at 22:07, Chandan Somani wrote:
>
> > This narrows down spelling errors that are in the commit
> > subject. In v2, it also provides a subject if the subject
> > line is missing. The provisional subject is the name of the
> > patch file, which should provide some context about the patch.
> >
> > Signed-off-by: Chandan Somani 
>
> Hi Chandan,
>
> Thanks for the patch! The robot found a problem, with a trailing white
> space.
>
> However I can fix this at commit time, also one small change below. Let me
> know if you agree and will fix this up during commit.
>
>Agreed, thanks.


> In addition, would it be possible to send an additional patch(series) to
> also do this on git-based patches, i.e. if you do something like
> ‘checkapatch.py -S -2’?
> Maybe there should be an error if the subject is missing, independent if
> spellcheck is enabled or not?
>
>   Yes, I'll work on this.

>
> Cheers,
>
> Eelco
>
>
> > ---
> >  utilities/checkpatch.py | 8 
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
> > index e5d5029f2..f34e4bf2a 100755
> > --- a/utilities/checkpatch.py
> > +++ b/utilities/checkpatch.py
> > @@ -1024,6 +1024,14 @@ def ovs_checkpatch_file(filename):
> >  result = ovs_checkpatch_parse(part.get_payload(decode=False),
> filename,
> >mail.get('Author', mail['From']),
> >mail['Commit'])
> > +if spellcheck:
> > +if not mail['Subject'].strip():
> > +mail.replace_header('Subject', sys.argv[-1])
> > +print("Subject missing! Your provisional subject is",
> > +  mail['Subject'])
>
> If the subject is missing from the patch it would error out.
> What about the following:
>
> +if spellcheck:
> +if not mail['Subject'] or not mail['Subject'].strip():
> +if mail['Subject']:
> +mail.replace_header('Subject', sys.argv[-1])
> +else:
> +mail.add_header('Subject', sys.argv[-1])
> +
> +print("Subject missing! Your provisional subject is",
> +  mail['Subject'])
> +
> +if check_spelling(mail['Subject'], False):
> +print("Subject: %s" % mail['Subject'])
> +
>
>
> > +if check_spelling(mail['Subject'], False):
> > +print("Subject: %s" % mail['Subject'])
> > +
> >  ovs_checkpatch_print_result()
> >  return result
> >
> > --
> > 2.26.3
> >
> > ___
> > dev mailing list
> > d...@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2 3/3] checkpatch: print subject field if misspelled or missing

2023-07-11 Thread Eelco Chaudron


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

> This narrows down spelling errors that are in the commit
> subject. In v2, it also provides a subject if the subject
> line is missing. The provisional subject is the name of the
> patch file, which should provide some context about the patch.
>
> Signed-off-by: Chandan Somani 

Hi Chandan,

Thanks for the patch! The robot found a problem, with a trailing white space.

However I can fix this at commit time, also one small change below. Let me know 
if you agree and will fix this up during commit.

In addition, would it be possible to send an additional patch(series) to also 
do this on git-based patches, i.e. if you do something like ‘checkapatch.py -S 
-2’?
Maybe there should be an error if the subject is missing, independent if 
spellcheck is enabled or not?


Cheers,

Eelco


> ---
>  utilities/checkpatch.py | 8 
>  1 file changed, 8 insertions(+)
>
> diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
> index e5d5029f2..f34e4bf2a 100755
> --- a/utilities/checkpatch.py
> +++ b/utilities/checkpatch.py
> @@ -1024,6 +1024,14 @@ def ovs_checkpatch_file(filename):
>  result = ovs_checkpatch_parse(part.get_payload(decode=False), filename,
>mail.get('Author', mail['From']),
>mail['Commit'])
> +if spellcheck:
> +if not mail['Subject'].strip():
> +mail.replace_header('Subject', sys.argv[-1])
> +print("Subject missing! Your provisional subject is",
> +  mail['Subject'])

If the subject is missing from the patch it would error out.
What about the following:

+if spellcheck:
+if not mail['Subject'] or not mail['Subject'].strip():
+if mail['Subject']:
+mail.replace_header('Subject', sys.argv[-1])
+else:
+mail.add_header('Subject', sys.argv[-1])
+
+print("Subject missing! Your provisional subject is",
+  mail['Subject'])
+
+if check_spelling(mail['Subject'], False):
+print("Subject: %s" % mail['Subject'])
+


> +if check_spelling(mail['Subject'], False):
> +print("Subject: %s" % mail['Subject'])
> +
>  ovs_checkpatch_print_result()
>  return result
>
> -- 
> 2.26.3
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

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


Re: [ovs-dev] [PATCH v2 3/3] checkpatch: print subject field if misspelled or missing

2023-07-07 Thread 0-day Robot
Bleep bloop.  Greetings Chandan Somani, I am a robot and I have tried out your 
patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Line has trailing whitespace
#27 FILE: utilities/checkpatch.py:1030:
print("Subject missing! Your provisional subject is", 

Lines checked: 38, Warnings: 1, Errors: 0


Please check this out.  If you feel there has been an error, please email 
acon...@redhat.com

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2 3/3] checkpatch: print subject field if misspelled or missing

2023-07-07 Thread Chandan Somani
This narrows down spelling errors that are in the commit
subject. In v2, it also provides a subject if the subject
line is missing. The provisional subject is the name of the
patch file, which should provide some context about the patch.

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

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index e5d5029f2..f34e4bf2a 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -1024,6 +1024,14 @@ def ovs_checkpatch_file(filename):
 result = ovs_checkpatch_parse(part.get_payload(decode=False), filename,
   mail.get('Author', mail['From']),
   mail['Commit'])
+if spellcheck:
+if not mail['Subject'].strip():
+mail.replace_header('Subject', sys.argv[-1])
+print("Subject missing! Your provisional subject is", 
+  mail['Subject'])
+if check_spelling(mail['Subject'], False):
+print("Subject: %s" % mail['Subject'])
+
 ovs_checkpatch_print_result()
 return result
 
-- 
2.26.3

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