[tracker/wip/carlosg/check-style-fixes: 4/4] check-style: Separate uncrustify.cfg file location to a variable
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/check-style-fixes: 4/4] check-style: Separate uncrustify.cfg file location to a variable
- Date: Tue, 13 Jul 2021 12:28:10 +0000 (UTC)
commit 459076758cbe6f7287bb25b6e85b44d97bfb6b4f
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Jul 13 14:27:25 2021 +0200
check-style: Separate uncrustify.cfg file location to a variable
So it's more easily visible.
check-style.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/check-style.py b/check-style.py
index eebd13659..3840e2e01 100755
--- a/check-style.py
+++ b/check-style.py
@@ -7,6 +7,9 @@ import subprocess
import sys
import tempfile
+# Path relative to this script
+uncrustify_cfg = 'utils/uncrustify.cfg'
+
def run_diff(sha):
proc = subprocess.Popen(["git", "diff", "-U0", "--function-context", sha, "HEAD"],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
files = proc.stdout.read().strip().decode('utf-8')
@@ -72,7 +75,7 @@ def reformat_chunks(chunks, rewrite):
tmp = create_temp_file(chunk['file'], chunk['start'], chunk['end'])
# uncrustify chunk
- proc = subprocess.Popen(["uncrustify", "-c", "./utils/uncrustify.cfg", "-f", tmp.name],
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
+ proc = subprocess.Popen(["uncrustify", "-c", uncrustify_cfg, "-f", tmp.name],
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
reindented = proc.stdout.readlines()
tmp.close()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]