From 0217f4c08d7ca3a3b8e34af877e90a7e5b0a15ce Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 11 May 2018 17:12:04 -0400 Subject: [PATCH] report line numbers for generated content more accurately Show the line numbers for content generated by the formatter. Go ahead and dump that output to the log, too, so someone can use it to debug build errors. Change-Id: Ib088df597d3b02e9040b90fece9552864d8f1fb7 Signed-off-by: Doug Hellmann --- reno/sphinxext.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reno/sphinxext.py b/reno/sphinxext.py index 177280a..3a60393 100644 --- a/reno/sphinxext.py +++ b/reno/sphinxext.py @@ -114,8 +114,9 @@ class ReleaseNotesDirective(rst.Directive): ) source_name = '<%s %s>' % (__name__, branch or 'current branch') result = statemachine.ViewList() - for line in text.splitlines(): - result.append(line, source_name) + for line_num, line in enumerate(text.splitlines(), 1): + info('{:>4d}: {}'.format(line_num, line)) + result.append(line, source_name, line_num) node = nodes.section() node.document = self.state.document