llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang-format Author: Eden Reich (edenreich) <details> <summary>Changes</summary> ## Summary Currently it's not backward compatible, because the flag -list-ignored doesn't exists on older version of clang-format. To make this tool still backward compatible, we can first check if the .clang-format-ignore file exists before we run clang-format with the -list-ignored flag. --- Full diff: https://github.com/llvm/llvm-project/pull/108721.diff 1 Files Affected: - (modified) clang/tools/clang-format/git-clang-format (+2) ``````````diff diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format index bacbd8de245666..997644045c1f25 100755 --- a/clang/tools/clang-format/git-clang-format +++ b/clang/tools/clang-format/git-clang-format @@ -402,6 +402,8 @@ def filter_symlinks(dictionary): def filter_ignored_files(dictionary, binary): """Delete every key in `dictionary` that is ignored by clang-format.""" + if not os.path.exists('.clang-format-ignore'): + return ignored_files = run(binary, '-list-ignored', *dictionary.keys()) if not ignored_files: return `````````` </details> https://github.com/llvm/llvm-project/pull/108721 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits