diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2016-08-08 14:46:51 +0100 |
---|---|---|
committer | Thibault Saunier <tsaunier@gnome.org> | 2016-08-09 14:40:25 -0400 |
commit | bda6c3c6cbcaf870e0f228683dcd3fc4063b5576 (patch) | |
tree | cdea745726569581cb910bd060007acfd21ae30e | |
parent | ea6b591d6ae4e3e57cb4985e823e8e7d2700dae3 (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-x | git-phab | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -747,7 +747,7 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri) def run_linter(self): if not os.path.exists(".pre-commit-config.yaml"): if os.path.exists(".arclint"): - return subprocess.check_output("arc lint", + return subprocess.check_output("arc lint --never-apply-patches", shell=True).decode("utf-8") else: return None @@ -969,7 +969,7 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri) print(" * Running linters...", end="") linter_status = "none" try: - self.run_linter() + print(self.run_linter()) print("%s OK%s" % (Colors.OKGREEN, Colors.ENDC)) linter_status = "okay" except BaseException as e: |