diff options
author | Mike Pattrick <mkp@redhat.com> | 2021-11-30 11:02:07 -0500 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-01-04 17:23:30 +0100 |
commit | d652fc6a5a6c78b0daeb389f28933570bb4ecb56 (patch) | |
tree | 50b3e01bbf4f8c7c1a5024b4395a136d6eb9a33f /utilities | |
parent | 28ef2535c1d729492e5bf76faa42dfacfa169bc1 (diff) | |
download | openvswitch-d652fc6a5a6c78b0daeb389f28933570bb4ecb56.tar.gz |
checkpatch: Correct line count in error messages.
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.
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'utilities')
-rwxr-xr-x | utilities/checkpatch.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py index bf95358d5..caf10537b 100755 --- a/utilities/checkpatch.py +++ b/utilities/checkpatch.py @@ -765,12 +765,16 @@ def ovs_checkpatch_parse(text, filename, author=None, committer=None): reset_counters() - for line in text.splitlines(): + for line in text.split("\n"): if current_file != previous_file: previous_file = current_file lineno = lineno + 1 total_line = total_line + 1 + + if line == "\f": + # Form feed + continue if len(line) <= 0: continue |