Documentation
¶
Overview ¶
Package lint checks that a codebase follows the inceptools layering rules.
A convention nothing enforces is a convention that decays. These are the rules this framework's shape depends on, each stated with the failure it prevents — because a lint rule whose reason nobody remembers gets disabled the first time it is inconvenient.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Rules = []string{
"service-imports-http",
"controller-imports-db",
"dto-imports-db",
"entity-imports-layer",
"cross-module-internals",
"module-has-no-module-file",
"app-has-no-root-file",
}
Rules are the rule names, so a configuration file can be checked against them rather than silently ignoring a typo.
Functions ¶
This section is empty.
Types ¶
type Finding ¶
type Finding struct {
Severity Severity
Rule string
Path string
Line int
Message string
// Why explains the failure the rule prevents. Printed with the finding,
// because "layering violation" teaches nobody anything.
Why string
}
Finding is one rule violation.
type Options ¶
type Options struct {
// Config carries the repository's conventions — which directories are
// which layer, where the domains live, which rules are on. Loaded from
// icpt.json; nil means the defaults.
Config *project.Config
// Root overrides the configuration's root.
Root string
// AppsDir overrides the configuration's domains directory.
AppsDir string
// Skip are extra path fragments to ignore.
Skip []string
}
Options configures a run.
Click to show internal directories.
Click to hide internal directories.