(code string, list []string)
| 81 | } |
| 82 | |
| 83 | func hasUnknownParameters(code string, list []string) bool { |
| 84 | r := regexp.MustCompile(`(?s)((?:\b_predict\(|\bpred\(|\btrain\().*)`) |
| 85 | c := r.FindStringSubmatch(code)[1] |
| 86 | r = regexp.MustCompile(`[(\s,](\w+)=.*,`) |
| 87 | for _, v := range r.FindStringSubmatch(c)[1:] { |
| 88 | if !contains(list, v) { |
| 89 | return true |
| 90 | } |
| 91 | } |
| 92 | return false |
| 93 | } |
| 94 | |
| 95 | func mockClusterConfig() *ClusterConfig { |
| 96 | return &ClusterConfig{ |
no test coverage detected