Checkpatch was not checking for commands such as [0].
[0] ovn_as az1 ovn-nbctl lr-route-add lr11 fd99::/64 2001:db8::2
Fixes: 937c930b2311 ("checkpatch: Ensure ovn-nbctl/sbctl commands have a
check.")
Signed-off-by: Xavier Simonart <[email protected]>
---
tests/checkpatch.at | 9 +++++++++
utilities/checkpatch.py | 4 ++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/tests/checkpatch.at b/tests/checkpatch.at
index b874b1ea6..352a5f4d2 100755
--- a/tests/checkpatch.at
+++ b/tests/checkpatch.at
@@ -656,6 +656,15 @@ try_checkpatch \
ovn-nbctl lsp-add ls
"
+try_checkpatch \
+ "COMMON_PATCH_HEADER([tests/something.at])
+ +ovn_as az1 ovn-nbctl lsp-add ls
+ " \
+ "WARNING: ovn-nbctl return should be checked Consider adding check or
check_uuid in front.
+ #8 FILE: tests/something.at:1:
+ ovn_as az1 ovn-nbctl lsp-add ls
+"
+
# Verify that existing check makes checkpatch happy.
try_checkpatch \
"COMMON_PATCH_HEADER([tests/something.at])
diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index ad1199f0c..d644db9e1 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -203,8 +203,8 @@ __regex_if_macros = re.compile(r'^ +(%s)
\([\S]([\s\S]+[\S])*\) { +\\' %
__regex_nonascii_characters = re.compile("[^\u0000-\u007f]")
__regex_efgrep = re.compile(r'.*[ef]grep.*$')
__regex_hardcoded_table =
re.compile(r'.*(table=[0-9]+)|.*(resubmit\(,[0-9]+\))')
-__regex_ovn_nbctl = re.compile(r'^\s*ovn-nbctl ')
-__regex_ovn_sbctl = re.compile(r'^\s*ovn-sbctl ')
+__regex_ovn_nbctl = re.compile(r'^\s*(?:ovn_as\s+\S+\s+)?ovn-nbctl\b')
+__regex_ovn_sbctl = re.compile(r'^\s*(?:ovn_as\s+\S+\s+)?ovn-sbctl\b')
skip_leading_whitespace_check = False
skip_trailing_whitespace_check = False
--
2.47.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev