(ts TestScore, check ks.Check, locationer ks.FileLocationer, annotations ...map[string]string)
| 92 | } |
| 93 | |
| 94 | func (so *ScoredObject) Add(ts TestScore, check ks.Check, locationer ks.FileLocationer, annotations ...map[string]string) { |
| 95 | ts.Check = check |
| 96 | so.FileLocation = locationer.FileLocation() |
| 97 | |
| 98 | var skip bool |
| 99 | if annotations != nil { |
| 100 | if len(annotations) == 1 && !so.isEnabled(check, annotations[0], nil) { |
| 101 | skip = true |
| 102 | } |
| 103 | if len(annotations) == 2 && !so.isEnabled(check, annotations[0], annotations[1]) { |
| 104 | skip = true |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | // This test is ignored (via annotations), don't save the score |
| 109 | if skip { |
| 110 | ts.Skipped = true |
| 111 | ts.Comments = []TestScoreComment{{Summary: fmt.Sprintf("Skipped because %s is ignored", check.ID)}} |
| 112 | } |
| 113 | |
| 114 | so.Checks = append(so.Checks, ts) |
| 115 | } |
| 116 | |
| 117 | type TestScore struct { |
| 118 | Check ks.Check |
no test coverage detected