mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
#104 add ineffassign check
This commit is contained in:
27
check/ineffassign.go
Normal file
27
check/ineffassign.go
Normal 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.`
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user