Documentation ¶
Overview ¶
Package license provides license policy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeaderCheck ¶
type HeaderCheck struct {
// contains filtered or unexported fields
}
HeaderCheck enforces a license header on source code files.
func (HeaderCheck) Errors ¶
func (l HeaderCheck) Errors() []error
Errors returns any violations of the check.
func (HeaderCheck) Message ¶
func (l HeaderCheck) Message() string
Message returns to check message.
type License ¶
type License struct { // SkipPaths applies gitignore-style patterns to file paths to skip completely // parts of the tree which shouldn't be scanned (e.g. .git/) SkipPaths []string `mapstructure:"skipPaths"` // IncludeSuffixes is the regex used to find files that the license policy // should be applied to. IncludeSuffixes []string `mapstructure:"includeSuffixes"` // ExcludeSuffixes is the Suffixes used to find files that the license policy // should not be applied to. ExcludeSuffixes []string `mapstructure:"excludeSuffixes"` // AllowPrecedingComments, when enabled, allows blank lines and `//` and `#` line comments // before the license header. Useful for code generators that put build constraints or // "DO NOT EDIT" lines before the license. AllowPrecedingComments bool `mapstructure:"allowPrecedingComments"` // Header is the contents of the license header. Header string `mapstructure:"header"` }
License implements the policy.Policy interface and enforces source code license headers.
func (*License) Compliance ¶
Compliance implements the policy.Policy.Compliance function.
func (License) ValidateLicenseHeader ¶
ValidateLicenseHeader checks the header of a file and ensures it contains the provided value.
Click to show internal directories.
Click to hide internal directories.