mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-29 06:49:05 +08:00
#52 add misspell
This commit is contained in:
31
check/misspell.go
Normal file
31
check/misspell.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package check
|
||||
|
||||
import "fmt"
|
||||
|
||||
// Misspell is the check for the misspell command
|
||||
type Misspell struct {
|
||||
Dir string
|
||||
Filenames []string
|
||||
}
|
||||
|
||||
// Name returns the name of the display name of the command
|
||||
func (g Misspell) Name() string {
|
||||
return "misspell"
|
||||
}
|
||||
|
||||
// Weight returns the weight this check has in the overall average
|
||||
func (g Misspell) Weight() float64 {
|
||||
return 0.0
|
||||
}
|
||||
|
||||
// Percentage returns the percentage of .go files that pass gofmt
|
||||
func (g Misspell) Percentage() (float64, []FileSummary, error) {
|
||||
params := AddSkipDirs([]string{"gometalinter", "--deadline=180s", "--disable-all", "--linter", "misspell:misspell ./*.go:PATH:LINE:MESSAGE", "--enable=misspell"})
|
||||
fmt.Println(params)
|
||||
return GoTool(g.Dir, g.Filenames, params)
|
||||
}
|
||||
|
||||
// Description returns the description of Misspell
|
||||
func (g Misspell) Description() string {
|
||||
return `<a href="https://github.com/client9/misspell">Misspell</a> Finds commonly misspelled English words`
|
||||
}
|
||||
@@ -139,6 +139,7 @@ func newChecksResp(repo string, forceRefresh bool) (checksResp, error) {
|
||||
check.GoLint{Dir: dir, Filenames: filenames},
|
||||
check.GoCyclo{Dir: dir, Filenames: filenames},
|
||||
check.License{Dir: dir, Filenames: []string{}},
|
||||
check.Misspell{Dir: dir, Filenames: filenames},
|
||||
}
|
||||
|
||||
ch := make(chan score)
|
||||
|
||||
Reference in New Issue
Block a user