Documentation
¶
Overview ¶
Package boundaries provides module boundary enforcement for monox.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker checks module boundaries.
func NewChecker ¶
NewChecker creates a new boundary checker.
type Config ¶
type Config struct {
Rules []Rule `json:"rules" yaml:"rules"`
}
Config holds boundary checking configuration.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns sensible default boundary configuration.
type Rule ¶
type Rule struct {
// SourceTag is the tag that this rule applies to
SourceTag string `json:"sourceTag" yaml:"sourceTag"`
// AllowedTags are tags that can be depended on
AllowedTags []string `json:"allowedTags" yaml:"allowedTags"`
// DisallowedTags are tags that cannot be depended on
DisallowedTags []string `json:"disallowedTags" yaml:"disallowedTags"`
// AllowCircular allows circular dependencies
AllowCircular bool `json:"allowCircular" yaml:"allowCircular"`
// NotDependOnLibsWithTags disallows depending on libs with these tags
NotDependOnLibsWithTags []string `json:"notDependOnLibsWithTags" yaml:"notDependOnLibsWithTags"`
// OnlyDependOnLibsWithTags only allows depending on libs with these tags
OnlyDependOnLibsWithTags []string `json:"onlyDependOnLibsWithTags" yaml:"onlyDependOnLibsWithTags"`
}
Rule defines a boundary rule.
func DefaultRules ¶
func DefaultRules() []Rule
DefaultRules returns sensible default boundary rules.
type Violation ¶
type Violation struct {
Project string `json:"project"`
File string `json:"file"`
Line int `json:"line"`
Column int `json:"column"`
Message string `json:"message"`
Rule string `json:"rule"`
Dependency string `json:"dependency"`
Severity string `json:"severity"`
}
Violation represents a boundary violation.
Click to show internal directories.
Click to hide internal directories.