[CI] enable code-format-helper for .cl files (#135748)

In clang-format, OpenCL .cl file uses default C++ formatting. There are
many pull-requests in libclc project that change OpenCL files. It is
beneficial to enable clang-format for them in CI.
This commit is contained in:
Wenju He 2025-04-16 11:34:59 +00:00 committed by GitHub
parent bb5f53c727
commit cf2399a2ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -186,7 +186,17 @@ class ClangFormatHelper(FormatHelper):
filtered_files = [] filtered_files = []
for path in changed_files: for path in changed_files:
_, ext = os.path.splitext(path) _, ext = os.path.splitext(path)
if ext in (".cpp", ".c", ".h", ".hpp", ".hxx", ".cxx", ".inc", ".cppm"): if ext in (
".cpp",
".c",
".h",
".hpp",
".hxx",
".cxx",
".inc",
".cppm",
".cl",
):
filtered_files.append(path) filtered_files.append(path)
elif ext == "" and self.should_include_extensionless_file(path): elif ext == "" and self.should_include_extensionless_file(path):
filtered_files.append(path) filtered_files.append(path)