Merge remote-tracking branch 'everyx/master'
This commit is contained in:
commit
436fee66c8
@ -7,6 +7,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
"unicode/utf8"
|
||||||
)
|
)
|
||||||
|
|
||||||
func check(err error) {
|
func check(err error) {
|
||||||
@ -31,7 +32,7 @@ func main() {
|
|||||||
foundLongLine := false
|
foundLongLine := false
|
||||||
lines := readLines(sourcePath)
|
lines := readLines(sourcePath)
|
||||||
for i, line := range lines {
|
for i, line := range lines {
|
||||||
if !foundLongLine && !commentPat.MatchString(line) && (len(line) > 58) {
|
if !foundLongLine && !commentPat.MatchString(line) && (utf8.RuneCountInString(line) > 58) {
|
||||||
fmt.Printf("measure: %s:%d\n", sourcePath, i+1)
|
fmt.Printf("measure: %s:%d\n", sourcePath, i+1)
|
||||||
foundLongLine = true
|
foundLongLine = true
|
||||||
foundLongFile = true
|
foundLongFile = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user