From 0abc11db813ddb491f2ac3d0ecbe6d41458608c9 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 26 Jun 2026 20:44:24 -0400 Subject: [PATCH] fix(scripts): clang format on cuda header files --- scripts/update_clang_format.py | 3 ++- tests/unit/test_update_clang_format.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/update_clang_format.py b/scripts/update_clang_format.py index 7608f90..f5a7454 100644 --- a/scripts/update_clang_format.py +++ b/scripts/update_clang_format.py @@ -1,4 +1,4 @@ -"""Run clang-format across shared C and C++ source directories.""" +"""Run clang-format across shared C, C++, Objective-C, and CUDA source directories.""" # standard imports import os @@ -15,6 +15,7 @@ 'c', 'cpp', 'cu', + 'cuh', 'h', 'hpp', 'm', diff --git a/tests/unit/test_update_clang_format.py b/tests/unit/test_update_clang_format.py index d790d1c..c076644 100644 --- a/tests/unit/test_update_clang_format.py +++ b/tests/unit/test_update_clang_format.py @@ -19,12 +19,13 @@ def test_directories_include_expected_roots(): def test_file_types_include_shared_extensions(): - """Verify the formatter includes shared C and C++ extensions.""" + """Verify the formatter includes shared source extensions.""" assert update_clang_format.file_types == [ 'c', 'cpp', 'cu', + 'cuh', 'h', 'hpp', 'm', @@ -65,6 +66,7 @@ def test_main_formats_supported_files_only(monkeypatch, tmp_path): files = [ os.path.join(tmp_root, 'src', 'main.cpp'), os.path.join(tmp_root, 'src', 'nested', 'kernel.cu'), + os.path.join(tmp_root, 'src', 'nested', 'kernel.cuh'), os.path.join(tmp_root, 'tests', 'test_helper.mm'), os.path.join(tmp_root, 'tools', 'tool.h'), os.path.join(tmp_root, 'tools', 'notes.txt'), @@ -90,6 +92,7 @@ def fake_clang_format(file): assert set(formatted_files) == { 'src/main.cpp', 'src/nested/kernel.cu', + 'src/nested/kernel.cuh', 'tests/test_helper.mm', 'tools/tool.h', }