Documentation
¶
Overview ¶
Package source turns command line arguments into scan targets: local repositories, directories and files, single GitHub repositories, or every repository of a user or organization.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶ added in v0.14.0
type Options struct {
github.ListOptions
// Files scans the working tree of a local repository as well as its
// object database, so untracked and ignored files are covered. A
// directory that is not a repository is always scanned as files.
Files bool
}
Options tune how arguments are resolved.
type Target ¶
type Target struct {
// Display is the name shown in reports.
Display string
// Local is the path of a local repository; empty for GitHub targets
// and for file trees without a repository behind them.
Local string
// Dir is the path of a directory, or a single file, whose files are
// scanned as they are on disk. It is set on its own for a directory
// that is not a repository, and next to Local when the working tree of
// a repository is scanned as well as its object database.
Dir string
// Repo describes a GitHub repository; nil for local targets.
Repo *github.Repo
}
Target is one repository or file tree to scan.
func Resolve ¶
func Resolve(ctx context.Context, client *github.Client, args []string, opts Options) ([]Target, error)
Resolve expands args into targets. An existing path is scanned in place: a repository through its object database, any other directory or a single file as files on disk. owner/name and github.com URLs name one repository; a bare owner expands to all repositories of that user or organization.
Click to show internal directories.
Click to hide internal directories.