summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2016-08-10 09:39:23 -0400
committerThibault Saunier <tsaunier@gnome.org>2016-08-10 12:15:06 -0400
commitfef7843866fcccfffa0f09e04b27bcf53a7373fe (patch)
treef081e1ea5432cb79218ea9def2887a908775e76f
parent0c13cb14b3f6270199725a28ab3a6af3754a4106 (diff)
Do not print `pre-commit` output and let user interact with arclint
Differential Revision: https://phabricator.freedesktop.org/D1270
-rwxr-xr-xgit-phab10
1 files changed, 5 insertions, 5 deletions
diff --git a/git-phab b/git-phab
index 9186546..ad00594 100755
--- a/git-phab
+++ b/git-phab
@@ -748,9 +748,9 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri)
748 def run_linter(self): 748 def run_linter(self):
749 if not os.path.exists(".pre-commit-config.yaml"): 749 if not os.path.exists(".pre-commit-config.yaml"):
750 if os.path.exists(".arclint"): 750 if os.path.exists(".arclint"):
751 return subprocess.check_output( 751 subprocess.check_call("arc lint --never-apply-patches",
752 "arc lint --never-apply-patches", 752 shell=True).decode("utf-8")
753 shell=True).decode("utf-8") 753 return None
754 else: 754 else:
755 return None 755 return None
756 command = ["pre-commit", "run", "--files"] 756 command = ["pre-commit", "run", "--files"]
@@ -971,12 +971,12 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri)
971 print(" * Running linters...", end="") 971 print(" * Running linters...", end="")
972 linter_status = "none" 972 linter_status = "none"
973 try: 973 try:
974 print(self.run_linter()) 974 self.run_linter()
975 print("%s OK%s" % (Colors.OKGREEN, Colors.ENDC)) 975 print("%s OK%s" % (Colors.OKGREEN, Colors.ENDC))
976 linter_status = "okay" 976 linter_status = "okay"
977 except BaseException as e: 977 except BaseException as e:
978 linter_status = "fail" 978 linter_status = "fail"
979 if isinstance(e, subprocess.CalledProcessError): 979 if isinstance(e, subprocess.CalledProcessError) and e.stdout:
980 linter_result = e.stdout.decode("utf-8") 980 linter_result = e.stdout.decode("utf-8")
981 else: 981 else:
982 linter_result = str(e) 982 linter_result = str(e)