mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 12:46:08 +00:00
[code-format] Also include libc++ extensionless headers and .inc and .cppm (#73142)
These headers were skipped by the job because they didn't have an extension. However, such headers are extremely common in libc++. As a drive-by change, also include `.cppm` and `.inc` extensions since those are also common in libc++.
This commit is contained in:
parent
32903b0b6d
commit
3e28e1ec56
@ -126,13 +126,18 @@ class ClangFormatHelper(FormatHelper):
|
||||
return True
|
||||
return False
|
||||
|
||||
def should_include_extensionless_file(self, path: str) -> bool:
|
||||
return path.startswith("libcxx/include")
|
||||
|
||||
def filter_changed_files(self, changed_files: list[str]) -> list[str]:
|
||||
filtered_files = []
|
||||
for path in changed_files:
|
||||
_, ext = os.path.splitext(path)
|
||||
if ext in (".cpp", ".c", ".h", ".hpp", ".hxx", ".cxx"):
|
||||
if ext in (".cpp", ".c", ".h", ".hpp", ".hxx", ".cxx", ".inc", ".cppm"):
|
||||
if not self.should_be_excluded(path):
|
||||
filtered_files.append(path)
|
||||
elif ext == "" and self.should_include_extensionless_file(path):
|
||||
filtered_files.append(path)
|
||||
return filtered_files
|
||||
|
||||
def format_run(
|
||||
|
Loading…
x
Reference in New Issue
Block a user