Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/manager/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"
"math/rand"
"net"
"regexp"
"sort"
"strings"
"sync"
Expand Down Expand Up @@ -817,11 +818,15 @@ func PatchFocusAreas(cfg *mgrconfig.Config, gitPatches [][]byte, baseHashes, pat
funcs := modifiedSymbols(baseHashes, patchedHashes)
if len(funcs) > 0 {
log.Logf(0, "adding modified_functions to focus areas: %q", funcs)
var regexps []string
for _, name := range funcs {
regexps = append(regexps, fmt.Sprintf("^%s$", regexp.QuoteMeta(name)))
}
cfg.Experimental.FocusAreas = append(cfg.Experimental.FocusAreas,
mgrconfig.FocusArea{
Name: symbolsArea,
Filter: mgrconfig.CovFilterCfg{
Functions: funcs,
Functions: regexps,
},
Weight: 6.0,
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ index 103167d..fbf7a68 100644
{
Name: symbolsArea,
Filter: mgrconfig.CovFilterCfg{
Functions: []string{"function"},
Functions: []string{"^function$"},
},
Weight: 6.0,
},
Expand Down
Loading