Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenameFiles ¶
RenameFiles renames the provided filenames to have a ".grc.bk" extension, so they will not be considered in future checks.
func RevertFiles ¶
RevertFiles removes the ".grc.bk" extension from files
Types ¶
type Check ¶
type Check interface { Name() string Description() string Weight() float64 // Percentage returns the passing percentage of the check, // as well as a map of filename to output Percentage() (float64, []FileSummary, error) }
Check describes what methods various checks (gofmt, go lint, etc.) should implement
type ErrCheck ¶
ErrCheck is the check for the errcheck command
func (ErrCheck) Description ¶
Description returns the description of gofmt
func (ErrCheck) Percentage ¶
func (c ErrCheck) Percentage() (float64, []FileSummary, error)
Percentage returns the percentage of .go files that pass gofmt
type FileSummary ¶
type FileSummary struct { Filename string `json:"filename"` FileURL string `json:"file_url"` Errors []Error `json:"errors"` }
FileSummary contains the filename, location of the file on GitHub, and all of the errors related to the file
func GoFmtNative ¶
func GoFmtNative(dir string, filenames []string) (float64, []FileSummary, error)
GoFmtNative runs gofmt via golang's stdlib format pkg
func GoTool ¶
func GoTool(dir string, filenames, command []string) (float64, []FileSummary, error)
GoTool runs a given go command (for example gofmt, go tool vet) on a directory
func (*FileSummary) AddError ¶
func (fs *FileSummary) AddError(out string) error
AddError adds an Error to FileSummary
type GoCyclo ¶
GoCyclo is the check for the go cyclo command
func (GoCyclo) Description ¶
Description returns the description of GoCyclo
func (GoCyclo) Percentage ¶
func (g GoCyclo) Percentage() (float64, []FileSummary, error)
Percentage returns the percentage of .go files that pass gofmt
type GoFmt ¶
GoFmt is the check for the go fmt command
func (GoFmt) Description ¶
Description returns the description of gofmt
func (GoFmt) Percentage ¶
func (g GoFmt) Percentage() (float64, []FileSummary, error)
Percentage returns the percentage of .go files that pass gofmt
type GoLint ¶
GoLint is the check for the go lint command
func (GoLint) Description ¶
Description returns the description of go lint
func (GoLint) Percentage ¶
func (g GoLint) Percentage() (float64, []FileSummary, error)
Percentage returns the percentage of .go files that pass golint
type GoVet ¶
GoVet is the check for the go vet command
func (GoVet) Description ¶
Description returns the description of go lint
func (GoVet) Percentage ¶
func (g GoVet) Percentage() (float64, []FileSummary, error)
Percentage returns the percentage of .go files that pass go vet
type IneffAssign ¶
IneffAssign is the check for the ineffassign command
func (IneffAssign) Description ¶
func (g IneffAssign) Description() string
Description returns the description of IneffAssign
func (IneffAssign) Name ¶
func (g IneffAssign) Name() string
Name returns the name of the display name of the command
func (IneffAssign) Percentage ¶
func (g IneffAssign) Percentage() (float64, []FileSummary, error)
Percentage returns the percentage of .go files that pass gofmt
func (IneffAssign) Weight ¶
func (g IneffAssign) Weight() float64
Weight returns the weight this check has in the overall average
type License ¶
License is the check for the existence of a license file
func (License) Description ¶
Description returns the description of License
func (License) Percentage ¶
func (g License) Percentage() (float64, []FileSummary, error)
Percentage returns 0 if no LICENSE, 1 if LICENSE
type Misspell ¶
Misspell is the check for the misspell command
func (Misspell) Description ¶
Description returns the description of Misspell
func (Misspell) Percentage ¶
func (g Misspell) Percentage() (float64, []FileSummary, error)
Percentage returns the percentage of .go files that pass gofmt