From b0ba2eeea5b816887ace3e72fe3beb2e3838e705 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 22 Feb 2017 22:59:51 -0500 Subject: [PATCH] add filename and sha in comments in report output Add debugging details with the filename and sha for the version of the content used so that each note that comes out in the report indicates where the content is from. Change-Id: I569f3dbd3df16f880c8f3fa0a1b5b1c1b77be45d Signed-off-by: Doug Hellmann --- .../show-note-filename-in-report-a1118c917588b58d.yaml | 7 +++++++ reno/formatter.py | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/show-note-filename-in-report-a1118c917588b58d.yaml diff --git a/releasenotes/notes/show-note-filename-in-report-a1118c917588b58d.yaml b/releasenotes/notes/show-note-filename-in-report-a1118c917588b58d.yaml new file mode 100644 index 0000000..286b754 --- /dev/null +++ b/releasenotes/notes/show-note-filename-in-report-a1118c917588b58d.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + The report output now includes debugging details with the filename + and sha for the version of the content used to indicate where the + content is from to assist with debugging formatting or content + issues. diff --git a/reno/formatter.py b/reno/formatter.py index 749dfbe..2aa8e30 100644 --- a/reno/formatter.py +++ b/reno/formatter.py @@ -61,12 +61,13 @@ def format_report(loader, versions_to_include, title=None): notefiles = loader[version] for n, sha in notefiles: if 'prelude' in file_contents[n]: + report.append('.. %s @ %s\n' % (n, sha)) report.append(file_contents[n]['prelude']) report.append('') for section_name, section_title in _SECTION_ORDER: notes = [ - n + (n, fn, sha) for fn, sha in notefiles if file_contents[fn].get(section_name) for n in file_contents[fn].get(section_name, []) @@ -75,7 +76,8 @@ def format_report(loader, versions_to_include, title=None): report.append(section_title) report.append('-' * len(section_title)) report.append('') - for n in notes: + for n, fn, sha in notes: + report.append('.. %s @ %s\n' % (fn, sha)) report.append('- %s' % _indent_for_list(n)) report.append('')