Return head findings whose signature isn't already present in base.
(head_findings, base_findings)
| 241 | # net-new diff |
| 242 | # --------------------------------------------------------------------------- # |
| 243 | def net_new(head_findings, base_findings): |
| 244 | """Return head findings whose signature isn't already present in base.""" |
| 245 | base_counts = collections.Counter(f["signature"] for f in base_findings) |
| 246 | new = [] |
| 247 | for f in head_findings: |
| 248 | sig = f["signature"] |
| 249 | if base_counts.get(sig, 0) > 0: |
| 250 | base_counts[sig] -= 1 |
| 251 | else: |
| 252 | new.append(f) |
| 253 | return new |
| 254 | |
| 255 | |
| 256 | def build_accept_file(repo_root): |