From ddca99b148aaefb1b7df3954d37dbefc73199630 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Thu, 15 Jun 2017 00:54:08 +0000 Subject: [PATCH] [clang-format] Allow git-clang-format to handle empty extensions. Most of libc++'s header files don't use extension. This prevents using git-clang-format on them, which is frustrating. This patch allows empty extensions to be passed using either the --extensions option, or the clangformat.extensions git-config value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305437 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/clang-format/git-clang-format | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/clang-format/git-clang-format b/tools/clang-format/git-clang-format index 71b9124149..60cd4fb25b 100755 --- a/tools/clang-format/git-clang-format +++ b/tools/clang-format/git-clang-format @@ -324,6 +324,8 @@ def filter_by_extension(dictionary, allowed_extensions): allowed_extensions = frozenset(allowed_extensions) for filename in list(dictionary.keys()): base_ext = filename.rsplit('.', 1) + if len(base_ext) == 1 and '' in allowed_extensions: + continue if len(base_ext) == 1 or base_ext[1].lower() not in allowed_extensions: del dictionary[filename] -- 2.50.1