Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decl ¶
type Decl struct {
// contains filtered or unexported fields
}
Decl is what one package directory declares, and where — the anchor for any diagnostic about it.
func (Decl) Path ¶
func (d Decl) Path() SourcePath
Path is the file that anchors a diagnostic about this package.
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key identifies one corresponding command/domain pair: the tree prefix holding the internal/ directory, and the verb path beneath the marker — kept separate so parallel internal trees stay distinct and either tier's directory can be spelled back for a diagnostic.
func (Key) CommandDir ¶
CommandDir and DomainDir spell the key's directory in each tier.
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Program is one main package that BUILDS a urfave command — a command tree, as opposed to a main that hands a declaration to a framework driver.
func (Program) Path ¶
func (p Program) Path() SourcePath
Path is the file that anchors a diagnostic about this program.
type Published ¶ added in v0.13.0
type Published struct {
// contains filtered or unexported fields
}
Published is one importable package a repository exposes: a directory of non-test Go files whose package is not main, which lies outside internal/, and which actually declares something.
func (Published) Describe ¶ added in v0.13.0
Describe names the package as a diagnostic's subject, RELATIVE to the repository.
The absolute path is already carried by Path, where a tool needs it to open the file; repeating it in the prose names a location true only on the machine that ran the check.
The package at the repository root has no directory to name — its relative path is "." — so naming it positionally says nothing about what to move. Naming it as what it is does.
func (Published) Path ¶ added in v0.13.0
func (p Published) Path() SourcePath
Path is the file that anchors a diagnostic about this package.
type SourcePath ¶
type SourcePath string
SourcePath is the path of one Go source file under the walked root.
type TierDir ¶
type TierDir string
TierDir is one tier's directory for a pair, spelled for a diagnostic.
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree is every self-declaring package of each tier, by pair key.
func Collect ¶
Collect walks the module once, parsing every non-test Go file beneath a tier marker and recording the packages that declare themselves.
func (Tree) BuildsProgram ¶ added in v0.13.0
BuildsProgram reports whether the repository builds a program under cmd/.
It is deliberately NOT limited to programs built from a particular framework. Whether a repository is a command is decided by its shipping one, whoever wrote the driver — and keying on the framework is precisely what let the analyzer repositories through, since their mains hand one analyzer to go/analysis's singlechecker and construct no command tree at all. That exemption is right for the tier rule, which asks whether a command tree is SPLIT correctly and has nothing to say about a program with no verbs. It is wrong here, because publishing a package is not a question about verbs.
func (Tree) Programs ¶
Programs is every command-building main package found, anchored at its first such file and ordered by directory so a report is deterministic.
One program, one entry: a tree split across several files of one main package is still one program, and counting files would make a four-file main look four times as significant as a one-file one.
func (Tree) PublishedPackages ¶ added in v0.13.0
PublishedPackages is every importable package the repository exposes, ordered by directory so a report is deterministic.