(reports: list[WarningReport])
| 1105 | reports_grouped_by_message.setdefault(wr.message, []).append(wr) |
| 1106 | |
| 1107 | def collapsed_location_report(reports: list[WarningReport]) -> str: |
| 1108 | locations = [] |
| 1109 | for w in reports: |
| 1110 | location = w.get_location(self.config) |
| 1111 | if location: |
| 1112 | locations.append(location) |
| 1113 | |
| 1114 | if len(locations) < 10: |
| 1115 | return "\n".join(map(str, locations)) |
| 1116 | |
| 1117 | counts_by_filename = Counter( |
| 1118 | str(loc).split("::", 1)[0] for loc in locations |
| 1119 | ) |
| 1120 | return "\n".join( |
| 1121 | "{}: {} warning{}".format(k, v, "s" if v > 1 else "") |
| 1122 | for k, v in counts_by_filename.items() |
| 1123 | ) |
| 1124 | |
| 1125 | title = "warnings summary (final)" if final else "warnings summary" |
| 1126 | self.write_sep("=", title, yellow=True, bold=False) |
nothing calls this directly
no test coverage detected