diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2021-07-13 14:27:25 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2021-07-13 14:27:25 +0200 |
commit | 459076758cbe6f7287bb25b6e85b44d97bfb6b4f (patch) | |
tree | cdc4b92a0cf420cf9737a2f71233030f81736d0f /check-style.py | |
parent | f153497c708a5392bd274a7f14172856e78e467e (diff) | |
download | tracker-459076758cbe6f7287bb25b6e85b44d97bfb6b4f.tar.gz |
check-style: Separate uncrustify.cfg file location to a variable
So it's more easily visible.
Diffstat (limited to 'check-style.py')
-rwxr-xr-x | check-style.py | 5 |
1 files changed, 4 insertions, 1 deletions
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() |