Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultScanners = []*toolchain.ToolRef{
{"sourcegraph.com/sourcegraph/srclib-javascript", "scan-commonjs"},
}
DefaultScanners are the scanners used for a Tree if none are manually specified in a Srcfile.
var ( // ErrInvalidFilePath indicates that a file path outside of the tree or // repository root directory was specified in the config. ErrInvalidFilePath = errors.New("invalid file path specified in config (above config root dir or source unit dir)") )
var Filename = "Srcfile"
Filename is the name of the file that configures a directory tree or repository. It is intended to be used by repository authors.
Functions ¶
This section is empty.
Types ¶
type External ¶
type External struct { // DefaultScanners is the default set of scanners to use. DefaultScanners []*toolchain.ToolRef }
An External configuration file, represented by this struct, can set system- and user-level settings for srclib.
var SrclibPathConfig External
SrclibPathConfig is stored in SRCLIBPATH/.srclibconfig.
type Repository ¶
type Repository struct { // URI is the repository's clone URI. URI repo.URI `json:",omitempty"` // Tree is the configuration for the top-level directory tree in the // repository. Tree }
Repository represents the config for an entire repository.
func ReadRepository ¶
func ReadRepository(dir string, repoURI repo.URI) (*Repository, error)
ReadRepository parses and validates the configuration for a repository. If no Srcfile exists, it returns the default configuration for the repository. If an overridden configuration is specified for the repository (hard-coded in the Go code), then it is used instead of the Srcfile or the default configuration.
type Tree ¶
type Tree struct { // SourceUnits is a list of source units in the repository, either specified // manually in the Srcfile or discovered automatically by the scanner. SourceUnits []*unit.SourceUnit `json:",omitempty"` // Scanners to use to scan for source units in this tree. Scanners []*toolchain.ToolRef `json:",omitempty"` // Config is an arbitrary key-value property map. Each property is passed to // every tool. Config map[string]string `json:",omitempty"` }
Tree represents the config for a directory and its subdirectories.