Documentation
¶
Overview ¶
Package walker provides a gitignore-aware file walker that returns all source files worth indexing from a given root directory.
Index ¶
Constants ¶
const ( ReasonLarge = "file exceeds max_file_size" ReasonBrokenSymlink = "broken symlink" ReasonSymlinkEscape = "symlink resolves outside the root" ReasonSymlinkDir = "symlinked directory not followed" ReasonNotRegular = "not a regular file" ReasonUnreadable = "unreadable" ReasonMissingRoot = "configured root not found" ReasonRootEscape = "configured root resolves outside the repo" )
Skip reasons reported in Result.Skipped.
Variables ¶
This section is empty.
Functions ¶
func Walk ¶
Walk traverses root and returns a sorted slice of relative paths for all source files that are not excluded by ignore rules or alwaysIgnoreDirs. extraIgnore is an optional list of additional gitignore-style patterns; it may be nil. Use WalkWith for roots, include globs, size caps and skip reports.
Types ¶
type Options ¶ added in v0.5.0
type Options struct {
ExtraIgnore []string // gitignore-style patterns skipped in addition to ignore files
Include []string // when non-empty, only files matching one of these globs are kept
Roots []string // scan only these subdirectories (relative, slash-separated)
MaxFileSize int64 // files larger than this many bytes are skipped; 0 disables
}
Options tunes WalkWith.