Skip to content

Commit 2ba481d

Browse files
committed
Rename first column of csv output to path
Signed-off-by: Ravi <jravi248@gmail.com>
1 parent 850399b commit 2ba481d

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/formattedcode/output_csv.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def collect_keys(mapping, key_group):
137137

138138
errors = scanned_file.pop('scan_errors', [])
139139

140-
file_info = OrderedDict(Resource=path)
140+
file_info = OrderedDict(path=path)
141141
file_info.update(((k, v) for k, v in scanned_file.items()
142142
# FIXME: info are NOT lists: lists are the actual scans
143143
if not isinstance(v, (list, dict))))
@@ -148,12 +148,12 @@ def collect_keys(mapping, key_group):
148148
yield file_info
149149

150150
for lic_exp in scanned_file.get('license_expressions', []):
151-
inf = OrderedDict(Resource=path, license_expression=lic_exp)
151+
inf = OrderedDict(path=path, license_expression=lic_exp)
152152
collect_keys(inf, 'license_expression')
153153
yield inf
154154

155155
for licensing in scanned_file.get('licenses', []):
156-
lic = OrderedDict(Resource=path)
156+
lic = OrderedDict(path=path)
157157
for k, val in licensing.items():
158158
# do not include matched text for now.
159159
if k == 'matched_text':
@@ -183,37 +183,37 @@ def collect_keys(mapping, key_group):
183183
yield lic
184184

185185
for copyr in scanned_file.get('copyrights', []):
186-
inf = OrderedDict(Resource=path)
186+
inf = OrderedDict(path=path)
187187
inf['copyright'] = copyr['value']
188188
inf['start_line'] = copyr['start_line']
189189
inf['end_line'] = copyr['start_line']
190190
collect_keys(inf, 'copyright')
191191
yield inf
192192

193193
for copyr in scanned_file.get('holders', []):
194-
inf = OrderedDict(Resource=path)
194+
inf = OrderedDict(path=path)
195195
inf['copyright_holder'] = copyr['value']
196196
inf['start_line'] = copyr['start_line']
197197
inf['end_line'] = copyr['start_line']
198198
collect_keys(inf, 'copyright')
199199
yield inf
200200

201201
for copyr in scanned_file.get('authors', []):
202-
inf = OrderedDict(Resource=path)
202+
inf = OrderedDict(path=path)
203203
inf['author'] = copyr['value']
204204
inf['start_line'] = copyr['start_line']
205205
inf['end_line'] = copyr['start_line']
206206
collect_keys(inf, 'copyright')
207207
yield inf
208208

209209
for email in scanned_file.get('emails', []):
210-
email_info = OrderedDict(Resource=path)
210+
email_info = OrderedDict(path=path)
211211
email_info.update(email)
212212
collect_keys(email_info, 'email')
213213
yield email_info
214214

215215
for url in scanned_file.get('urls', []):
216-
url_info = OrderedDict(Resource=path)
216+
url_info = OrderedDict(path=path)
217217
url_info.update(url)
218218
collect_keys(url_info, 'url')
219219
yield url_info
@@ -286,7 +286,7 @@ def flatten_package(_package, path, prefix='package__'):
286286

287287
package_columns = get_package_columns()
288288

289-
pack = OrderedDict(Resource=path)
289+
pack = OrderedDict(path=path)
290290
for k, val in _package.items():
291291
if k not in package_columns:
292292
continue

0 commit comments

Comments
 (0)