On Tue, Jul 11, 2023 at 12:38 AM Eelco Chaudron <echau...@redhat.com> 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 <csom...@redhat.com>
>
> 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

Reply via email to