Skip to content

Commit d9ba058

Browse files
committed
Merge remote-tracking branch 'JRavi2/rename-first-column-in-csv' into develop
2 parents 37d574b + f9cbf75 commit d9ba058

13 files changed

Lines changed: 307 additions & 307 deletions

File tree

src/formattedcode/output_csv.py

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

114114
errors = scanned_file.pop('scan_errors', [])
115115

116-
file_info = dict(Resource=path)
116+
file_info = dict(path=path)
117117
file_info.update(((k, v) for k, v in scanned_file.items()
118118
# FIXME: info are NOT lists: lists are the actual scans
119119
if not isinstance(v, (list, dict))))
@@ -124,12 +124,12 @@ def collect_keys(mapping, key_group):
124124
yield file_info
125125

126126
for lic_exp in scanned_file.get('license_expressions', []):
127-
inf = dict(Resource=path, license_expression=lic_exp)
127+
inf = dict(path=path, license_expression=lic_exp)
128128
collect_keys(inf, 'license_expression')
129129
yield inf
130130

131131
for licensing in scanned_file.get('licenses', []):
132-
lic = dict(Resource=path)
132+
lic = dict(path=path)
133133
for k, val in licensing.items():
134134
# do not include matched text for now.
135135
if k == 'matched_text':
@@ -159,37 +159,37 @@ def collect_keys(mapping, key_group):
159159
yield lic
160160

161161
for copyr in scanned_file.get('copyrights', []):
162-
inf = dict(Resource=path)
162+
inf = dict(path=path)
163163
inf['copyright'] = copyr['value']
164164
inf['start_line'] = copyr['start_line']
165165
inf['end_line'] = copyr['start_line']
166166
collect_keys(inf, 'copyright')
167167
yield inf
168168

169169
for copyr in scanned_file.get('holders', []):
170-
inf = dict(Resource=path)
170+
inf = dict(path=path)
171171
inf['copyright_holder'] = copyr['value']
172172
inf['start_line'] = copyr['start_line']
173173
inf['end_line'] = copyr['start_line']
174174
collect_keys(inf, 'copyright')
175175
yield inf
176176

177177
for copyr in scanned_file.get('authors', []):
178-
inf = dict(Resource=path)
178+
inf = dict(path=path)
179179
inf['author'] = copyr['value']
180180
inf['start_line'] = copyr['start_line']
181181
inf['end_line'] = copyr['start_line']
182182
collect_keys(inf, 'copyright')
183183
yield inf
184184

185185
for email in scanned_file.get('emails', []):
186-
email_info = dict(Resource=path)
186+
email_info = dict(path=path)
187187
email_info.update(email)
188188
collect_keys(email_info, 'email')
189189
yield email_info
190190

191191
for url in scanned_file.get('urls', []):
192-
url_info = dict(Resource=path)
192+
url_info = dict(path=path)
193193
url_info.update(url)
194194
collect_keys(url_info, 'url')
195195
yield url_info
@@ -263,7 +263,7 @@ def flatten_package(_package, path, prefix='package__'):
263263

264264
package_columns = get_package_columns()
265265

266-
pack = dict(Resource=path)
266+
pack = dict(path=path)
267267
for k, val in _package.items():
268268
if k not in package_columns:
269269
continue
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Resource,type,scan_errors,license_expression
2-
apache-2.0.LICENSE,file,,
3-
apache-2.0.LICENSE,,,apache-2.0
4-
apache-2.0.LICENSE,,,mit
1+
path,type,scan_errors,license_expression
2+
apache-2.0.LICENSE,file,,
3+
apache-2.0.LICENSE,,,apache-2.0
4+
apache-2.0.LICENSE,,,mit

0 commit comments

Comments
 (0)