1
0
mirror of https://github.com/golang/go synced 2024-11-22 05:24:39 -07:00

codereview: print gofmt message when aborting

R=r
CC=vish
http://go/go-review/1026013
This commit is contained in:
Russ Cox 2009-11-06 18:40:30 -08:00
parent b2d3701cce
commit f74beebb2f

View File

@ -594,11 +594,11 @@ def CheckGofmt(ui, repo, files, just_warn=False):
ui.warn("gofmt errors:\n" + errors.rstrip() + "\n") ui.warn("gofmt errors:\n" + errors.rstrip() + "\n")
return return
if len(data) > 0: if len(data) > 0:
msg = "gofmt needs to format these files (run hg gofmt):\n" + data msg = "gofmt needs to format these files (run hg gofmt):\n" + Indent(data, "\t").rstrip()
if just_warn: if just_warn:
ui.warn("warning: " + msg) ui.warn("warning: " + msg + "\n")
else: else:
raise util.Abort() raise util.Abort(msg)
return return
####################################################################### #######################################################################