mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-29 06:49:05 +08:00
golint fixes
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package check
|
||||
|
||||
// Check describes what methods various checks (gofmt, go lint, etc.)
|
||||
// should implement
|
||||
type Check interface {
|
||||
Name() string
|
||||
Description() string
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package check
|
||||
|
||||
// GoVet is the check for the go vet command
|
||||
type GoVet struct {
|
||||
Dir string
|
||||
Filenames []string
|
||||
}
|
||||
|
||||
// Name returns the name of the display name of the command
|
||||
func (g GoVet) Name() string {
|
||||
return "go_vet"
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package check
|
||||
|
||||
// GoCycle is the check for the go cyclo command
|
||||
type GoCyclo struct {
|
||||
Dir string
|
||||
Filenames []string
|
||||
}
|
||||
|
||||
// Name returns the name of the display name of the command
|
||||
func (g GoCyclo) Name() string {
|
||||
return "gocyclo"
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package check
|
||||
|
||||
// GoFmt is the check for the go fmt command
|
||||
type GoFmt struct {
|
||||
Dir string
|
||||
Filenames []string
|
||||
}
|
||||
|
||||
// Name returns the name of the display name of the command
|
||||
func (g GoFmt) Name() string {
|
||||
return "gofmt"
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package check
|
||||
|
||||
// GoLint is the check for the go lint command
|
||||
type GoLint struct {
|
||||
Dir string
|
||||
Filenames []string
|
||||
}
|
||||
|
||||
// Name returns the name of the display name of the command
|
||||
func (g GoLint) Name() string {
|
||||
return "golint"
|
||||
}
|
||||
|
||||
@@ -54,11 +54,15 @@ func lineCount(filepath string) (int, error) {
|
||||
return count, nil
|
||||
}
|
||||
|
||||
// Error contains the line number and the reason for
|
||||
// an error output from a command
|
||||
type Error struct {
|
||||
LineNumber int `json:"line_number"`
|
||||
ErrorString string `json:"error_string"`
|
||||
}
|
||||
|
||||
// FileSummary contains the filename, location of the file
|
||||
// on GitHub, and all of the errors related to the file
|
||||
type FileSummary struct {
|
||||
Filename string `json:"filename"`
|
||||
FileURL string `json:"file_url"`
|
||||
|
||||
Reference in New Issue
Block a user