mirror of
https://github.com/MonsterDruide1/OdysseyDecomp.git
synced 2024-10-06 18:13:23 +00:00
workflow: Fix warnings in check-format.py
with python 3.12 (#158)
This commit is contained in:
parent
b51a8b420a
commit
c3b7c93285
@ -36,13 +36,13 @@ def common_no_namespace_qualifiers(c, path):
|
||||
for line in c.splitlines():
|
||||
line = line[0:line.find("//")] if "//" in line else line
|
||||
if line.startswith("using namespace"):
|
||||
match = re.search("^using namespace ([^;\s]+);$", line)
|
||||
match = re.search(r"^using namespace ([^;\s]+);$", line)
|
||||
if CHECK(lambda a:match, line, "Unexpected \"using namespace\" line: should follow format \"using namespace xy;\"", path): return
|
||||
continue
|
||||
if CHECK(lambda a:a.rfind("namespace") in [-1, 0], line, "\"namespace\" must only be listed at the start of a line!", path): return
|
||||
|
||||
if line.startswith("namespace"):
|
||||
match = re.search("^namespace ([^{\s]*) ?{$", line)
|
||||
match = re.search(r"^namespace ([^{\s]*) ?{$", line)
|
||||
if CHECK(lambda a:match, line, "Unexpected namespace line: should follow format \"namespace xy {\"", path): return
|
||||
nest_level.append(match.group(1))
|
||||
# can be "" for "namespace {" and "nn::g3d" for double/triple/... namespaces
|
||||
@ -67,7 +67,7 @@ def common_no_namespace_qualifiers(c, path):
|
||||
del nest_level[-1]
|
||||
continue
|
||||
|
||||
matches = re.findall("[\(,\s]([^\(,\s]+::)+[^\(,\s]+", x)
|
||||
matches = re.findall(r"[\(,\s]([^\(,\s]+::)+[^\(,\s]+", x)
|
||||
for match in matches:
|
||||
match = match[0:-2]
|
||||
# examples: "sead", "al", "nn::g3d"
|
||||
|
Loading…
Reference in New Issue
Block a user