Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Rule ¶
type Rule struct {
// Skip files in the Rule path.
// Example: say that we have a directory for a CRUD CLI tool:
// [".", "root.go", "get.go", "post.go", "delete.go"]
// If we only want to test the CRUD files, we would skip "." and "root.go"
//
// Thinking about reversing this into just Files, with {} being all.
SkipFiles []string
// Imports that should not be in a file
// Can be used to enforce things like dependency injection (No dbmodels in handler)
ForbiddenImports []string
// Imports that are necessary in a file
// Useful for making things like challenges
NecessaryImports []string
// Should the files only use modules include
// in [NecessaryImports]?
OnlyNecessaryImports bool
// contains filtered or unexported fields
}
Rule is a struct to define rules to be enforced in the Go codebase. Define a rule and pass them into [RunRule]
Click to show internal directories.
Click to hide internal directories.