[clang] [clang-format] fix: add missing `default_extensions` values to `git-clang-format` (PR #117730)

via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 26 07:52:35 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-format

Author: 루밀LuMir (lumirlumir)

<details>
<summary>Changes</summary>

Hello,

Although the properties listed in the code below are used as supported file extensions, some of these extensions do not exist in `git-clang-format`. This causes inconsistency when using `git-clang-format` with `clang-format`.

Therefore, I added the missing supported default extensions to `git-clang-format`.

https://github.com/llvm/llvm-project/blob/b214ca82daeece1568268ebc0fbcc2eaa649425b/clang/tools/clang-format/ClangFormat.cpp#L87-L96

---
Full diff: https://github.com/llvm/llvm-project/pull/117730.diff


1 Files Affected:

- (modified) clang/tools/clang-format/git-clang-format (+4-2) 


``````````diff
diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format
index bacbd8de245666..6a2a2a22ec5c2b 100755
--- a/clang/tools/clang-format/git-clang-format
+++ b/clang/tools/clang-format/git-clang-format
@@ -94,11 +94,13 @@ def main():
       # Other languages that clang-format supports
       'proto', 'protodevel',  # Protocol Buffers
       'java',  # Java
-      'js',  # JavaScript
+      'mjs', 'js',  # JavaScript
       'ts',  # TypeScript
       'cs',  # C Sharp
       'json',  # Json
-      'sv', 'svh', 'v', 'vh', # Verilog
+      'sv', 'svh', 'v', 'vh',  # Verilog
+      'td',  # TableGen
+      'txtpb', 'textpb', 'pb.txt', 'textproto', 'asciipb',  # TextProto
       ])
 
   p = argparse.ArgumentParser(

``````````

</details>


https://github.com/llvm/llvm-project/pull/117730


More information about the cfe-commits mailing list