From f91090e4a34e1ccc1d6caf996a62f01796c18a76 Mon Sep 17 00:00:00 2001 From: David Horstmann Date: Fri, 16 Dec 2022 13:39:04 +0000 Subject: [PATCH] Fix an incorrect regex in check_names.py Allow check_names.py to detect declarations of the form: enum some_enum_name { This pattern has only just appeared due to code style correction, which explains why the issue was not previously noticed. Signed-off-by: David Horstmann --- tests/scripts/check_names.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/scripts/check_names.py b/tests/scripts/check_names.py index 13b6c2dcf3..7398f3c2d1 100755 --- a/tests/scripts/check_names.py +++ b/tests/scripts/check_names.py @@ -444,8 +444,11 @@ class CodeParser(): # Match typedefs and brackets only when they are at the # beginning of the line -- if they are indented, they might # be sub-structures within structs, etc. + optional_c_identifier = r"([_a-zA-Z][_a-zA-Z0-9]*)?" if (state == states.OUTSIDE_KEYWORD and - re.search(r"^(typedef +)?enum +{", line)): + re.search(r"^(typedef +)?enum " + \ + optional_c_identifier + \ + r" *{", line)): state = states.IN_BRACES elif (state == states.OUTSIDE_KEYWORD and re.search(r"^(typedef +)?enum", line)):