summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2016-08-08 14:46:51 +0100
committerThibault Saunier <tsaunier@gnome.org>2016-08-09 14:40:25 -0400
commitbda6c3c6cbcaf870e0f228683dcd3fc4063b5576 (patch)
treecdea745726569581cb910bd060007acfd21ae30e
parentea6b591d6ae4e3e57cb4985e823e8e7d2700dae3 (diff)
git-phab: Add --never-apply-patches argument to `arc lint`
The linting infrastructure in git-phab assumes that the linter is not interactive; if it is (as `arc lint` can sometimes be, for example when running its clang-format plugin), everything will seemingly hang, as git-phab is waiting for `arc lint` to complete before it will print the output from it, and `arc lint` is waiting for user input after printing a prompt which the user has not seen. Fix that by automatically answering negatively to all `arc lint` questions, which are typically of the form ‘do you want to make this automatic indentation change?’. The questions should then be printed afterwards. Signed-off-by: Philip Withnall <philip.withnall@collabora.co.uk> Differential Revision: https://phabricator.freedesktop.org/D1251
-rwxr-xr-xgit-phab4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-phab b/git-phab
index 3292f26..20a910e 100755
--- a/git-phab
+++ b/git-phab
@@ -747,7 +747,7 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri)
747 def run_linter(self): 747 def run_linter(self):
748 if not os.path.exists(".pre-commit-config.yaml"): 748 if not os.path.exists(".pre-commit-config.yaml"):
749 if os.path.exists(".arclint"): 749 if os.path.exists(".arclint"):
750 return subprocess.check_output("arc lint", 750 return subprocess.check_output("arc lint --never-apply-patches",
751 shell=True).decode("utf-8") 751 shell=True).decode("utf-8")
752 else: 752 else:
753 return None 753 return None
@@ -969,7 +969,7 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri)
969 print(" * Running linters...", end="") 969 print(" * Running linters...", end="")
970 linter_status = "none" 970 linter_status = "none"
971 try: 971 try:
972 self.run_linter() 972 print(self.run_linter())
973 print("%s OK%s" % (Colors.OKGREEN, Colors.ENDC)) 973 print("%s OK%s" % (Colors.OKGREEN, Colors.ENDC))
974 linter_status = "okay" 974 linter_status = "okay"
975 except BaseException as e: 975 except BaseException as e: