Documentation
¶
Overview ¶
Package guardrails implements repository surface-area checks.
Index ¶
- func CheckBudgetCounts(data string, inventoryCounts map[string]int) []string
- func CheckCanonicalExecutorDocs(data string) []string
- func CheckCompatibilityDocs(data string) []string
- func CheckCompatibilityReleaseClaims(data string) []string
- func CheckDependencyRules(packages []Package, rules []DependencyRule) []string
- func CheckDeprecations(root string, now time.Time) ([]string, error)
- func CheckForbiddenProductionSymbols(packages []Package) ([]string, error)
- func CompareInventory(name string, expected, actual []string) error
- func DiscoverExamples(root string) ([]string, error)
- func DiscoverModules(root string) ([]string, error)
- func MatchPackage(pattern, importPath string) bool
- func ModulePath(directory string) (string, error)
- func ParseRecipes(data string) []string
- func PublicAPI(packages []Package) ([]string, error)
- func PublicAPIForModule(packages []Package, path string) ([]string, error)
- func PublicPackages(packages []Package) []string
- func PublicPackagesForModule(packages []Package, path string) []string
- func ReadInventory(path string) ([]string, error)
- func TopLevelDirectories(root string) ([]string, error)
- func WriteInventory(path, description string, values []string) error
- type DependencyRule
- type Package
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckBudgetCounts ¶
CheckBudgetCounts verifies that the Current column in BUDGETS.md agrees with the counts derived from the reviewed inventories.
func CheckCanonicalExecutorDocs ¶
CheckCanonicalExecutorDocs rejects stale claims for unsupported outbound resolvers.
func CheckCompatibilityDocs ¶
CheckCompatibilityDocs requires the documented v0.4 introduction boundary for the compatibility import paths.
func CheckCompatibilityReleaseClaims ¶
CheckCompatibilityReleaseClaims rejects affirmative claims that v0.3.0 publishes a compat/v03 path. It recognizes both release-first and path-first wording so a claim cannot evade the check by changing its word order.
func CheckDependencyRules ¶
func CheckDependencyRules(packages []Package, rules []DependencyRule) []string
CheckDependencyRules checks direct imports. Transitive dependencies are checked at their own direct edge.
func CheckDeprecations ¶
CheckDeprecations requires a future removal deadline on hand-written Go deprecations.
func CheckForbiddenProductionSymbols ¶
CheckForbiddenProductionSymbols rejects removed declarations in non-test Go files. Keep this source-level check alongside dependency rules so deleted authorities cannot be reintroduced behind an otherwise legal import edge.
func CompareInventory ¶
CompareInventory returns a useful error when expected and actual lines differ.
func DiscoverExamples ¶
DiscoverExamples returns immediate runnable example directories. Shared assets without Go source remain under examples but are not product examples.
func DiscoverModules ¶
DiscoverModules returns every repository Go module, including untracked modules.
func MatchPackage ¶
MatchPackage reports whether an import path matches an exact or /... pattern.
func ModulePath ¶
ModulePath reads the declared module path from a module directory.
func ParseRecipes ¶
ParseRecipes returns the sorted recipe inventory from a Justfile.
func PublicAPI ¶
PublicAPI returns a deterministic source-level inventory of root exported declarations.
func PublicAPIForModule ¶
PublicAPIForModule returns exported declarations for one declared module.
func PublicPackages ¶
PublicPackages returns importable root-module packages outside internal directories.
func PublicPackagesForModule ¶
PublicPackagesForModule returns importable packages for one declared module.
func ReadInventory ¶
ReadInventory reads nonempty, non-comment lines.
func TopLevelDirectories ¶
TopLevelDirectories returns reviewed product directories that contain at least one included source or configuration asset. Untracked assets are included deliberately; generated output is excluded by Git ignore rules.
func WriteInventory ¶
WriteInventory writes a generated inventory with its review warning.
Types ¶
type DependencyRule ¶
DependencyRule prohibits direct imports from one package pattern to another.
func LoadDependencyRules ¶
func LoadDependencyRules(path string) ([]DependencyRule, error)
LoadDependencyRules parses tab-separated from, to, and reason fields.