Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finding ¶
type Finding struct {
// The name of the file that this finding is for.
Path string `json:"path"`
// The lines that this finding applies to.
Lines LineRange `json:"lines"`
// A human-readable message about what the finding is.
Message string `json:"message"`
// Possible fixes that could be applied to resolve the problem.
// Each fix in this slice would independently fix the problem, they do not
// and should not all be applied.
Fixes []Fix `json:"fixes"`
}
Finding is something that keep-sorted thinks is wrong with a particular file.
type Fix ¶
type Fix struct {
// The changes that should be made to the file to resolve the Finding.
// All of these changes need to be made.
Replacements []Replacement `json:"replacements"`
}
Fix is a set of changes that could be made to resolve a Finding.
type Fixer ¶
type Fixer struct {
ID string
// contains filtered or unexported fields
}
Fixer runs the business logic of keep-sorted.
func New ¶
New creates a new fixer with the given string as its identifier. By default, id is "keep-sorted"
type LineRange ¶
LineRange is a 1-based range of continuous lines within a file. Both start and end are inclusive. You can designate a single line by setting start and end to the same line number.
func (LineRange) HighAtDimension ¶
func (LineRange) LowAtDimension ¶
func (LineRange) OverlapsAtDimension ¶
func (lr LineRange) OverlapsAtDimension(i augmentedtree.Interval, d uint64) bool
type Replacement ¶
type Replacement struct {
// The lines that should be replaced with NewContent.
Lines LineRange `json:"lines"`
NewContent string `json:"new_content"`
}
Replacement is a single substitution to apply to a file.
Click to show internal directories.
Click to hide internal directories.