File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,15 @@ import (
99// DefaultLocations provides default locations for the CODEOWNERS file
1010var DefaultLocations = [... ]string {"CODEOWNERS" , "docs/CODEOWNERS" , ".github/CODEOWNERS" }
1111
12+ // sanitiseLine removes all empty space and comments from a given line
13+ func sanitiseLine (line string ) string {
14+ i := strings .Index (line , "#" )
15+ if i >= 0 {
16+ line = line [:i ]
17+ }
18+ return strings .Trim (line , " " )
19+ }
20+
1221// ParseLine parses a CODEOWNERS line into file pattern and owners
1322func ParseLine (line string ) (string , []string ) {
1423 line = sanitiseLine (line )
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package codeowners
33import (
44 "bufio"
55 "io"
6- "strings"
76)
87
98// Decoder providers functionality to read CODEOWNERS data
@@ -39,15 +38,6 @@ func (d *Decoder) peek() {
3938 }
4039}
4140
42- // sanitiseLine removes all empty space and comments from a given line
43- func sanitiseLine (line string ) string {
44- i := strings .Index (line , "#" )
45- if i >= 0 {
46- line = line [:i ]
47- }
48- return strings .Trim (line , " " )
49- }
50-
5141// More returns true if there are available CODEOWNERS lines to be scanned.
5242// And also advances to the next line.
5343func (d * Decoder ) More () bool {
You can’t perform that action at this time.
0 commit comments