summaryrefslogtreecommitdiff
path: root/check-style.py
diff options
context:
space:
mode:
authorHunor Csomortáni <csomh@redhat.com>2022-12-02 16:28:00 +0100
committerCarlos Garnacho <carlosg@gnome.org>2022-12-07 12:29:23 +0100
commite974451f39a4dfeccaa61b8e6d75a98c5f9df7a1 (patch)
tree2b837e79a6363a1d5ac8d75f4403360191c920f6 /check-style.py
parentd37b4a637eb364a42b7eceaaf208e76a791ccf43 (diff)
downloadtracker-e974451f39a4dfeccaa61b8e6d75a98c5f9df7a1.tar.gz
check-style: Improve the proposed git-rebase command
Include the sha used for the dry-run instead of using 'origin/main'.
Diffstat (limited to 'check-style.py')
-rwxr-xr-xcheck-style.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/check-style.py b/check-style.py
index 955f478ec..c68927241 100755
--- a/check-style.py
+++ b/check-style.py
@@ -120,7 +120,7 @@ def reformat_chunks(chunks, rewrite):
return changed
-parser = argparse.ArgumentParser(description='Check code style.')
+parser = argparse.ArgumentParser(description='Check code style. Needs uncrustify installed.')
parser.add_argument('--sha', metavar='SHA', type=str,
help='SHA for the commit to compare HEAD with')
parser.add_argument('--dry-run', '-d', type=bool,
@@ -146,7 +146,11 @@ if dry_run is not True and rewrite is True:
subprocess.run(["git", "commit", "--all", "--amend", "-C", "HEAD"], stdout=subprocess.DEVNULL)
os._exit(0)
elif dry_run is True and changed is True:
- print ("\nIssue the following command in your local tree to apply the suggested changes (needs uncrustify installed):\n\n $ git rebase origin/main --exec \"./check-style.py -r\" \n")
+ print(f"""
+Issue the following command in your local tree to apply the suggested changes:
+
+ $ git rebase {sha} --exec "./check-style.py -r"
+""")
os._exit(-1)
os._exit(0)