Skip to content

Commit f05ff1d

Browse files
Fix end_line incorrectly assigned from start_line in CSV output #4785
In flatten_scan(), the end_line field for copyrights, holders, and authors was assigned copyr['start_line'] instead of copyr['end_line']. This caused the end_line column in CSV output to always equal start_line, losing the actual end line information. Signed-off-by: codewithfourtix <codewithfourtix@gmail.com>
1 parent d320c97 commit f05ff1d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/formattedcode/output_csv.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,23 +185,23 @@ def collect_keys(mapping, key_group):
185185
inf = dict(path=path)
186186
inf['copyright'] = copyr['copyright']
187187
inf['start_line'] = copyr['start_line']
188-
inf['end_line'] = copyr['start_line']
188+
inf['end_line'] = copyr['end_line']
189189
collect_keys(inf, 'copyright')
190190
yield inf
191191

192192
for copyr in scanned_file.get('holders', []):
193193
inf = dict(path=path)
194194
inf['holder'] = copyr['holder']
195195
inf['start_line'] = copyr['start_line']
196-
inf['end_line'] = copyr['start_line']
196+
inf['end_line'] = copyr['end_line']
197197
collect_keys(inf, 'copyright')
198198
yield inf
199199

200200
for copyr in scanned_file.get('authors', []):
201201
inf = dict(path=path)
202202
inf['author'] = copyr['author']
203203
inf['start_line'] = copyr['start_line']
204-
inf['end_line'] = copyr['start_line']
204+
inf['end_line'] = copyr['end_line']
205205
collect_keys(inf, 'copyright')
206206
yield inf
207207

0 commit comments

Comments
 (0)