mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
28 lines
864 B
Go
28 lines
864 B
Go
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.05
|
|
}
|
|
|
|
// 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.`
|
|
}
|