summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-08-23 13:18:06 +0200
committerCarlos Garnacho <carlosg@gnome.org>2021-08-23 13:18:06 +0200
commita717e20e3070717f5b9d9a2e45d8b5cd2ef8be89 (patch)
tree2041c95fe551c29938b7a3360e2a75c73ae683ae
parent117027d9fd5a556c25b410e2201b294493ad5c14 (diff)
downloadmutter-wip/carlosg/skip-broken-uncrustify-calls.tar.gz
ci: Ignore uncrustify calls resulting in unsuccessful return codeswip/carlosg/skip-broken-uncrustify-calls
If for some reason uncrustify gets angry at our file and indent on/off marks, it will result in an error code other than 0. Since in those cases there is no output to diff with, we misinterpret those situations as "the whole file should be deleted", which is far from it.
-rwxr-xr-xcheck-style.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/check-style.py b/check-style.py
index ac2ffcaad..a326cd311 100755
--- a/check-style.py
+++ b/check-style.py
@@ -76,6 +76,10 @@ def reformat_chunks(chunks, rewrite):
# uncrustify chunk
proc = subprocess.Popen(["uncrustify", "-c", uncrustify_cfg, "-f", tmp.name], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
+ proc.wait()
+ if proc.returncode != 0:
+ continue
+
reindented = proc.stdout.readlines()
tmp.close()