#104 add ineffassign check

This commit is contained in:
Shawn Smith
2016-03-19 00:36:06 +09:00
parent 37d05c874b
commit 41260decd3
2 changed files with 28 additions and 0 deletions

27
check/ineffassign.go Normal file
View File

@@ -0,0 +1,27 @@
package check
// IneffAssign is the check for the ineffassign command
type IneffAssign struct {
Dir string
Filenames []string
}
// Name returns the name of the display name of the command
func (g IneffAssign) Name() string {
return "ineffassign"
}
// Weight returns the weight this check has in the overall average
func (g IneffAssign) Weight() float64 {
return 0.0
}
// Percentage returns the percentage of .go files that pass gofmt
func (g IneffAssign) Percentage() (float64, []FileSummary, error) {
return GoTool(g.Dir, g.Filenames, []string{"gometalinter", "--deadline=180s", "--disable-all", "--enable=ineffassign"})
}
// Description returns the description of IneffAssign
func (g IneffAssign) Description() string {
return `<a href="https://github.com/gordonklaus/ineffassign">IneffAssign</a> detects ineffectual assignments in Go code.`
}

View File

@@ -156,6 +156,7 @@ func newChecksResp(repo string, forceRefresh bool) (checksResp, error) {
check.GoCyclo{Dir: dir, Filenames: filenames},
check.License{Dir: dir, Filenames: []string{}},
check.Misspell{Dir: dir, Filenames: filenames},
check.IneffAssign{Dir: dir, Filenames: filenames},
}
ch := make(chan score)