mirror of
https://github.com/golang/go
synced 2024-11-22 10:54:46 -07:00
codereview: print gofmt message when aborting
R=r CC=vish http://go/go-review/1026013
This commit is contained in:
parent
b2d3701cce
commit
f74beebb2f
@ -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
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user