in src/advisor/reports/report.py [0:0]
def write(self, output_file, report_errors=False, report_remarks=False, include_summary=False):
items = {}
for item_type in ReportItem.TYPES:
items[item_type] = []
all_items = []
if report_remarks:
all_items += self.remarks
all_items += self.issues
if report_errors:
all_items += self.errors
for item in all_items:
items[item.item_type].append(item)
if include_summary:
items[ReportItem.SUMMARY].append(
FilesScannedRemark(len(self.source_files)))
if not items[ReportItem.NEGATIVE] and not items[ReportItem.NEUTRAL] and report_remarks:
items[ReportItem.POSITIVE].append(NoIssuesFoundRemark())
sorted_items = []
for item_type in ReportItem.TYPES:
sorted_items += sorted(items[item_type], key=lambda item: (
(item.filename if item.filename else '') + ':' + item.description))
self.write_items(output_file, sorted_items)