[ovs-dev] [PATCH v1] checkpatch: Correct line count in error messages

Ilya Maximets i.maximets at ovn.org
Mon Nov 29 23:09:09 UTC 2021

On 11/19/21 15:15, Aaron Conole wrote:
> Mike Pattrick <mkp at redhat.com> writes:
>> As part of some previous checkpatch work, we discovered that checkpatch
>> isn't always reporting correct line numbers. As it turns out, Python's
>> splitlines function considers several characters to be new lines which
>> common text editors do not typically consider to be new lines. For
>> example, form feed characters, which this code base uses to cluster
>> functionality.
>> To retain a very similar functionality to what exists now, we will
>> split on "\r?\n" and strip off the other characters that previously
>> splitlines was splitting on.

Looks way too complex to me.  Can we just skip and not count lines with
a single ^L on them instead?  They are supposed to be on their own lines.
And there should be no other control characters in the code.

Best regards, Ilya Maximets.

>> Signed-off-by: Mike Pattrick <mkp at redhat.com>
>> ---
> Thanks for the fix.  I noticed it when I ran
>   $ ./utilities/checkpatch.py -f ofproto/ofproto.c
> and the line numbers started to drift.  With this change, I don't see
> that behavior any longer.
> Acked-by: Aaron Conole <aconole at redhat.com>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

More information about the dev mailing list