#52 add misspell

This commit is contained in:
Shawn Smith
2016-01-11 16:14:01 +09:00
parent 6f6796e22d
commit 02c4c874a8
2 changed files with 32 additions and 0 deletions

31
check/misspell.go Normal file
View 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`
}

View File

@@ -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)