Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
testdata/ | H | 30-Mar-2019 | - | 18 | 18 | |
.travis.yml | H A D | 30-Mar-2019 | 85 | 10 | 8 | |
Makefile | H A D | 30-Mar-2019 | 56 | 6 | 4 | |
README.md | H A D | 30-Mar-2019 | 1.3 KiB | 49 | 33 | |
go.mod | H A D | 30-Mar-2019 | 113 | 7 | 5 | |
go.sum | H A D | 30-Mar-2019 | 924 | 12 | 11 | |
ignorefile.go | H A D | 30-Mar-2019 | 1.5 KiB | 72 | 54 | |
matcher.go | H A D | 30-Mar-2019 | 2.4 KiB | 114 | 91 | |
matcher_test.go | H A D | 30-Mar-2019 | 5.8 KiB | 188 | 161 | |
pattern.go | H A D | 30-Mar-2019 | 4.8 KiB | 228 | 167 | |
statemap.go | H A D | 30-Mar-2019 | 3 KiB | 152 | 129 | |
xignore.go | H A D | 30-Mar-2019 | 848 | 32 | 17 |
README.md
1[![Build Status][travis-image]][travis-url] 2[![GoDoc][godoc-image]][godoc-url] 3[![GitHub release][release-image]][release-url] 4 5# xignore 6 7A golang package for pattern matching of file paths. Like gitignore, dockerignore chefignore. 8 9 10## Requirements 11 12* Golang ≥ 1.11 13 14 15## Use 16 17```golang 18result := xignore.DirMatches("/workspace/my_project", &MatchesOptions{ 19 Ignorefile: ".gitignore", 20 Nested: true, // Handle nested ignorefile 21}) 22 23// ignorefile rules matched files 24fmt.Printf("%#v\n", result.MatchedFiles) 25// ignorefile rules unmatched files 26fmt.Printf("%#v\n", result.UnmatchedFiles) 27// ignorefile rules matched dirs 28fmt.Printf("%#v\n", result.MatchedDirs) 29// ignorefile rules unmatched dirs 30fmt.Printf("%#v\n", result.UnmatchedDirs) 31``` 32 33 34## LICENSE 35[MIT](https://github.com/zealic/xignore/blob/master/LICENSE.txt) 36 37 38## Reference 39 40* https://git-scm.com/docs/gitignore 41* https://github.com/moby/moby/blob/master/pkg/fileutils/fileutils.go 42 43[travis-image]: https://travis-ci.org/zealic/xignore.svg 44[travis-url]: https://travis-ci.org/zealic/xignore 45[godoc-image]: https://godoc.org/github.com/zealic/xignore?status.svg 46[godoc-url]: https://godoc.org/github.com/zealic/xignore 47[release-image]: https://img.shields.io/github/release/zealic/xignore.svg 48[release-url]: https://github.com/zealic/go2node/releases/xignore 49