diff --git a/pkg/fs/ignore.go b/pkg/fs/ignore.go index 98d2f9361..5d5220548 100644 --- a/pkg/fs/ignore.go +++ b/pkg/fs/ignore.go @@ -84,7 +84,7 @@ func (l *IgnoreList) AppendItems(dir string, patterns []string) error { } for _, pattern := range patterns { - if pattern != "" { + if pattern != "" && !strings.HasPrefix(pattern, "#") { l.items = append(l.items, NewIgnoreItem(dir, pattern, l.caseSensitive)) } } diff --git a/pkg/fs/testdata/directory/.ppignore b/pkg/fs/testdata/directory/.ppignore index 30261d31c..b5870401c 100644 --- a/pkg/fs/testdata/directory/.ppignore +++ b/pkg/fs/testdata/directory/.ppignore @@ -1,4 +1,6 @@ *.txt test.md + +# This is a comment somefile.* baz*