]> Cypherpunks repositories - gostls13.git/commitdiff
codereview: gofmt check for non-src/ files
authorDavid Crawshaw <david.crawshaw@zentus.com>
Fri, 18 Nov 2011 20:42:30 +0000 (12:42 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 18 Nov 2011 20:42:30 +0000 (12:42 -0800)
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

lib/codereview/codereview.py

index da6bbd5f3e61538e429bbf966d8ed623fd42a385..fa8dabd3970db04e2d8bd012b4ea7181abe5d383 100644 (file)
@@ -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
 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:
                return
        cwd = os.getcwd()