mirror of
https://github.com/golang/go
synced 2024-11-22 03:24:41 -07:00
codereview: do not gofmt deleted files
R=r https://golang.org/cl/164083
This commit is contained in:
parent
aaa2374b74
commit
9a86cc679a
@ -622,6 +622,7 @@ def CheckGofmt(ui, repo, files, just_warn=False):
|
|||||||
return
|
return
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
files = [RelativePath(repo.root + '/' + f, cwd) for f in files]
|
files = [RelativePath(repo.root + '/' + f, cwd) for f in files]
|
||||||
|
files = [f for f in files if os.access(f, 0)]
|
||||||
try:
|
try:
|
||||||
cmd = subprocess.Popen(["gofmt", "-l"] + files, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
|
cmd = subprocess.Popen(["gofmt", "-l"] + files, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
|
||||||
cmd.stdin.close()
|
cmd.stdin.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user