feat(parser): unify default init score = 0 (#73)
This commit is contained in:
parent
6a7787a974
commit
5de4c3ee78
|
@ -14,7 +14,7 @@ type Match struct {
|
|||
}
|
||||
|
||||
type Conf struct {
|
||||
Score int `default:"100"`
|
||||
Score int
|
||||
RootDir string `default:"/w"`
|
||||
Matches []Match
|
||||
Stdout string `default:"stdout"`
|
||||
|
|
|
@ -17,7 +17,7 @@ type Match struct {
|
|||
}
|
||||
|
||||
type Conf struct {
|
||||
Score int `default:"100"`
|
||||
Score int
|
||||
Matches []Match
|
||||
Stdout string `default:"stdout"`
|
||||
Stderr string `default:"stderr"`
|
||||
|
|
|
@ -13,7 +13,8 @@ type Match struct {
|
|||
}
|
||||
|
||||
type Conf struct {
|
||||
FullScore int
|
||||
Score int
|
||||
FullScore int // TODO: remove me
|
||||
MinScore int
|
||||
Files []string
|
||||
ForceQuitOnMatch bool
|
||||
|
@ -25,7 +26,7 @@ type Keyword struct{}
|
|||
func Parse(executorResult stage.ExecutorResult, conf Conf) (
|
||||
stage.ParserResult, bool,
|
||||
) {
|
||||
score := conf.FullScore
|
||||
score := conf.Score
|
||||
comment := ""
|
||||
matched := false
|
||||
for _, file := range conf.Files {
|
||||
|
@ -54,6 +55,10 @@ func (*Keyword) Run(results []stage.ExecutorResult, confAny any) (
|
|||
if err != nil {
|
||||
return nil, true, err
|
||||
}
|
||||
// TODO: remove me on FullScore field removed
|
||||
if conf.FullScore != 0 && conf.Score == 0 {
|
||||
conf.Score = conf.FullScore
|
||||
}
|
||||
var res []stage.ParserResult
|
||||
forceQuit := false
|
||||
for _, result := range results {
|
||||
|
|
Loading…
Reference in New Issue
Block a user