diff options
| author | Kitzunu <24550914+Kitzunu@users.noreply.github.com> | 2025-02-10 20:24:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-10 20:24:28 +0100 |
| commit | 787b4e4efe8c81e82e3926cb3a51a96bfa97af2a (patch) | |
| tree | 6ad35fa5ddf3570ded069e87bb0a9b8aa048df13 /apps/codestyle/codestyle-cpp.py | |
| parent | 017cfb7b4bf17417a9e9564e2fc75fb6ac143bdc (diff) | |
fix(CI/Codestyle): correct double semicolon check (#21388)
Diffstat (limited to 'apps/codestyle/codestyle-cpp.py')
| -rw-r--r-- | apps/codestyle/codestyle-cpp.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/codestyle/codestyle-cpp.py b/apps/codestyle/codestyle-cpp.py index 77ff3f3764..7b0dea93fa 100644 --- a/apps/codestyle/codestyle-cpp.py +++ b/apps/codestyle/codestyle-cpp.py @@ -223,7 +223,7 @@ def misc_codestyle_check(file: io, file_path: str) -> None: # used to check for "if/else (...) {" "} else" ignores "if/else (...) {...}" "#define ... if/else (...) {" ifelse_curlyregex = r"^[^#define].*\s+(if|else)(\s*\(.*\))?\s*{[^}]*$|}\s*else(\s*{[^}]*$)" # used to catch double semicolons ";;" ignores "(;;)" - double_semiregex = r"[^(];;[^)]" + double_semiregex = r"(?<!\()\s*;;(?!\))" # used to catch tabs tab_regex = r"\t" @@ -245,7 +245,7 @@ def misc_codestyle_check(file: io, file_path: str) -> None: print( f"Curly brackets are not allowed to be leading or trailing if/else statements. Place it on a new line: {file_path} at line {line_number}") check_failed = True - if re.match(double_semiregex, line): + if re.search(double_semiregex, line): print( f"Double semicolon (;;) found in {file_path} at line {line_number}") check_failed = True |
