From 4798409a9531c6958207b4f104a7417c3bc627aa Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 13 Jun 2026 01:18:51 +0200 Subject: project-clang-format.py: try to respect .clang-format-ignore --- tools/project-clang-format.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/project-clang-format.py b/tools/project-clang-format.py index f760579..a626a63 100755 --- a/tools/project-clang-format.py +++ b/tools/project-clang-format.py @@ -88,7 +88,12 @@ class ClangFormat: @staticmethod def _show_diff(path, formatted): - original = read_file(path).split('\n') + original = read_file(path) + if original and not formatted: + # Assuming this file is ignored in .clang-format-ignore. + return True + + original = original.split('\n') formatted = formatted.split('\n') original_lbl = f'{path} (original)' formatted_lbl = f'{path} (formatted)' -- cgit v1.3