Merge pull request #8939 from daverodgman/codestyle-autogen

Codestyle autogen fix
This commit is contained in:
Dave Rodgman 2024-03-18 14:26:59 +00:00 committed by GitHub
commit 374704255d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,6 +51,13 @@ def list_generated_files() -> FrozenSet[str]:
checks = re.findall(CHECK_CALL_RE, content)
return frozenset(word for s in checks for word in s.split())
# Check for comment string indicating an auto-generated file
AUTOGEN_RE = re.compile(r"Warning[ :-]+This file is (now )?auto[ -]?generated",
re.ASCII | re.IGNORECASE)
def is_file_autogenerated(filename):
content = open(filename, encoding="utf-8").read()
return AUTOGEN_RE.search(content) is not None
def get_src_files(since: Optional[str]) -> List[str]:
"""
Use git to get a list of the source files.
@ -85,7 +92,8 @@ def get_src_files(since: Optional[str]) -> List[str]:
# generated files (we're correcting the templates instead).
src_files = [filename for filename in src_files
if not (filename.startswith("3rdparty/") or
filename in generated_files)]
filename in generated_files or
is_file_autogenerated(filename))]
return src_files
def get_uncrustify_version() -> str: