From 72a1791372ac45f19aa2406fd0670c47adeb1894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hunor=20Csomort=C3=A1ni?= Date: Fri, 2 Dec 2022 14:37:49 +0100 Subject: [PATCH] check-style: Don't turn off formatting when the chunk starts on line 1 Before this, new files introduced by the range of commits checked were not considered for formatting b/c uncrustify was always turned off in the beginning of the files, and never turned back on. Part-of: --- check-style.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check-style.py b/check-style.py index 94dcd2ad9..29f719c43 100755 --- a/check-style.py +++ b/check-style.py @@ -42,7 +42,8 @@ def reformat_chunks(chunks, rewrite): def create_temp_file(file, start, end): with open(file) as f: tmp = tempfile.NamedTemporaryFile() - tmp.write(b'/** *INDENT-OFF* **/\n') + if start > 1: + tmp.write(b'/** *INDENT-OFF* **/\n') for i, line in enumerate(f, start=1): if i == start - 1: tmp.write(b'/** *INDENT-ON* **/\n')