summaryrefslogtreecommitdiff
path: root/check-style.py
diff options
context:
space:
mode:
authorHunor Csomortáni <csomh@redhat.com>2022-12-02 14:37:49 +0100
committerCarlos Garnacho <carlosg@gnome.org>2022-12-07 12:29:23 +0100
commit655deba98917d2ff4498eda261861112d6c1d672 (patch)
treebe3a9b8a08c6784241a63f9e476fb393c42e86aa /check-style.py
parent2970ac3449d13734458da1e3738111010163d7d6 (diff)
downloadtracker-655deba98917d2ff4498eda261861112d6c1d672.tar.gz
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.
Diffstat (limited to 'check-style.py')
-rwxr-xr-xcheck-style.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/check-style.py b/check-style.py
index 8721b8589..bae6fa4ed 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')