As spotted in CL 499981, 3 out of 51 of the api/next/*.txt files
ended up with a blank line at the end. It's possible it would've
been more if human reviewers didn't catch them.
Since there's no formatter for these files, the only way to help
catch things is to make the check pickier (as done in CL 431335).
It can be loosened to let in useful blank lines if needed in the
future.
Change-Id: Iae7ee8e782b32707c576150914539ac4cc0faec4
Reviewed-on: https://go-review.googlesource.com/c/go/+/500115
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
log.Printf("%s: contains CRLFs", filename)
exitCode = 1
}
+ if filepath.Base(filename) == "go1.4.txt" {
+ // No use for blank lines in api files, except go1.4.txt
+ // used them in a reasonable way and we should let it be.
+ } else if strings.HasPrefix(s, "\n") || strings.Contains(s, "\n\n") {
+ log.Printf("%s: contains a blank line", filename)
+ exitCode = 1
+ }
if s == "" {
log.Printf("%s: empty file", filename)
exitCode = 1