Compare commits
2 Commits
18cd2a8c4d
...
f04a471969
Author | SHA1 | Date | |
---|---|---|---|
f04a471969 | |||
698a6193cc |
|
@ -41,7 +41,7 @@ type Binder struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b Binder) String() string {
|
func (b Binder) String() string {
|
||||||
return fmt.Sprintf("In the definition of %s (at %s)", b.Binder, b.Pos)
|
return fmt.Sprintf("in the definition of %s (at %s)", b.Binder, b.Pos)
|
||||||
}
|
}
|
||||||
|
|
||||||
type Binders []Binder
|
type Binders []Binder
|
||||||
|
@ -51,7 +51,12 @@ func (bs Binders) String() string {
|
||||||
for _, b := range bs {
|
for _, b := range bs {
|
||||||
s = append(s, b.String())
|
s = append(s, b.String())
|
||||||
}
|
}
|
||||||
return strings.Join(s, "; ")
|
combinedStr := strings.Join(s, "; ")
|
||||||
|
if len(combinedStr) > 0 && combinedStr[0] == 'i' {
|
||||||
|
return "I" + combinedStr[1:]
|
||||||
|
}
|
||||||
|
|
||||||
|
return combinedStr
|
||||||
}
|
}
|
||||||
|
|
||||||
type Source struct {
|
type Source struct {
|
||||||
|
|
|
@ -35,14 +35,19 @@ func (p *Elf) parse(executorResult stage.ExecutorResult, conf Conf) stage.Parser
|
||||||
slog.Error("elf parse", "mapstructure decode err", err)
|
slog.Error("elf parse", "mapstructure decode err", err)
|
||||||
}
|
}
|
||||||
comment += fmt.Sprintf("### [%s] %s\n", report.File, report.Name)
|
comment += fmt.Sprintf("### [%s] %s\n", report.File, report.Name)
|
||||||
for _, caseObj := range report.Cases {
|
caseScore := 0
|
||||||
|
for range report.Cases {
|
||||||
for _, match := range conf.Matches {
|
for _, match := range conf.Matches {
|
||||||
for _, keyword := range match.Keywords {
|
for _, keyword := range match.Keywords {
|
||||||
if strings.Contains(kind, keyword) {
|
if strings.Contains(kind, keyword) {
|
||||||
score += -match.Score
|
caseScore += -match.Score
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
score += caseScore
|
||||||
|
comment += fmt.Sprintf("%d point(s)\n", caseScore)
|
||||||
|
for _, caseObj := range report.Cases {
|
||||||
switch kind {
|
switch kind {
|
||||||
case "ParenDep":
|
case "ParenDep":
|
||||||
// "<binders>:\n<context> below reaches a parentheses depths of <depths>:\n<code>"
|
// "<binders>:\n<context> below reaches a parentheses depths of <depths>:\n<code>"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user