Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNonAbsoluteProjectPath = errors.New("project path is not an absolute path") ErrInsecureProjectPath = errors.New("project path is insecure") ErrInsecureTargetPath = errors.New("target path is insecure") ErrOutsideBounds = errors.New("final path is not inside project directory") )
Functions ¶
func ExcludesWalker ¶
ExcludesWalker returns an iterator that yields the entries from a filepath.WalkDir call, filtered by the ExcludesMatcher for 'targetPath'.
func GetRelativePath ¶
GetRelativePath ensures that 'targetPath' does not attempt to escape 'projectPath', and returns the combined path if it can be done safely.
Types ¶
type ExcludeMatcher ¶
type ExcludeMatcher struct {
// contains filtered or unexported fields
}
ExcludeMatcher wraps the gitignore Matcher from go-git and handles the path-splitting it requires automatically.
func GetExcludeMatcher ¶
func GetExcludeMatcher(projectPath string) ExcludeMatcher
GetExcludeMatcher looks at a few locations to get exclusion files, then returns an ExcludeMatcher that will exclude files referenced within them. Those files are:
- [projectPath]/.smokeignore - $HOME/.smokeignore - $XDG_CONFIG_HOME/smoke/ignore - $HOME/config/smoke/ignore (if no $XDG_CONFIG_HOME defined)