mirror of
https://github.com/golang/go
synced 2024-11-24 22:00:09 -07:00
codereview: gofmt check for non-src/ files
Gives other projects the benefit of the gofmt presubmit. Results in minor changes in the doc/ directory: find doc -name \*.go -exec gofmt -d {} \; R=rsc, gri CC=golang-dev https://golang.org/cl/5158042
This commit is contained in:
parent
95474b6283
commit
28cead8b6c
@ -895,7 +895,7 @@ def CheckFormat(ui, repo, files, just_warn=False):
|
|||||||
|
|
||||||
# Check that gofmt run on the list of files does not change them
|
# Check that gofmt run on the list of files does not change them
|
||||||
def CheckGofmt(ui, repo, files, just_warn):
|
def CheckGofmt(ui, repo, files, just_warn):
|
||||||
files = [f for f in files if (f.startswith('src/') or f.startswith('test/bench/')) and f.endswith('.go')]
|
files = [f for f in files if (not f.startswith('test/') or f.startswith('test/bench/')) and f.endswith('.go')]
|
||||||
if not files:
|
if not files:
|
||||||
return
|
return
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
|
Loading…
Reference in New Issue
Block a user