Commit d96ce234 authored by Audrius Butkevicius's avatar Audrius Butkevicius

Add comments directive to ignores

parent 760a9d6d
...@@ -122,6 +122,8 @@ func parseIgnoreFile(fd io.Reader, currentFile string, seen map[string]bool) (Pa ...@@ -122,6 +122,8 @@ func parseIgnoreFile(fd io.Reader, currentFile string, seen map[string]bool) (Pa
switch { switch {
case line == "": case line == "":
continue continue
case strings.HasPrefix(line, "//"):
continue
case strings.HasPrefix(line, "#"): case strings.HasPrefix(line, "#"):
err = addPattern(line) err = addPattern(line)
case strings.HasSuffix(line, "/**"): case strings.HasSuffix(line, "/**"):
......
...@@ -133,3 +133,21 @@ func TestCaseSensitivity(t *testing.T) { ...@@ -133,3 +133,21 @@ func TestCaseSensitivity(t *testing.T) {
} }
} }
} }
func TestCommentsAndBlankLines(t *testing.T) {
stignore := `
// foo
//bar
//!baz
//#dex
// ips
`
pats, _ := ignore.Parse(bytes.NewBufferString(stignore), ".stignore")
if len(pats) > 0 {
t.Errorf("Expected no patterns")
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment