Skip to content

Commit 5e5b7bb

Browse files
Fix license refereces and other test failures
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent 9660e38 commit 5e5b7bb

File tree

3 files changed

+30
-25
lines changed

3 files changed

+30
-25
lines changed

src/formattedcode/output_html.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ def process_codebase(self, codebase, html, **kwargs):
8484
license_references = codebase.attributes.license_references
8585
template_loc = join(TEMPLATES_DIR, 'html', 'template.html')
8686
output_file = html
87-
write_templated(output_file, results, license_references, version, template_loc)
87+
write_templated(
88+
output_file=output_file,
89+
results=results,
90+
license_references=license_references,
91+
version=version,
92+
template_loc=template_loc,
93+
)
8894

8995

9096
@output_impl

src/formattedcode/templates/html/template.html

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -259,41 +259,42 @@
259259
</table>
260260
{% endif %}
261261

262-
{% if licenses %}
262+
{% if license_references %}
263263
<table>
264-
<caption>Licenses</caption>
264+
<caption>License References</caption>
265265
<thead>
266266
<tr>
267267
<th>key</th>
268268
<th>short_name</th>
269269
<th>category</th>
270270
<th>owner</th>
271-
<th>reference_url</th>
271+
<th>scancode_url</th>
272+
<th>licensedb_url</th>
272273
<th>homepage_url</th>
273-
<th>text_url</th>
274+
<th>text_urls</th>
274275
<th>spdx_license_key</th>
275276
<th>spdx_url</th>
276277
</tr>
277278
</thead>
278279
<tbody>
279-
{% for license_reference in license_references %}
280-
<tr id="license_{{ license_reference.key }}">
281-
<td>{{ license_reference.key }}</td>
282-
<td>{{ license_reference.short_name }}</td>
283-
<td>{{ license_reference.category }}</td>
284-
<td>{{ license_reference.owner }}</td>
285-
<td>{{ license_reference.scancode_url|urlize(target='_blank') }}</td>
286-
<td>{{ license_reference.licensedb_url|urlize(target='_blank') }}</td>
287-
<td>{{ license_reference.homepage_url|urlize(target='_blank') }}</td>
288-
<td>
289-
{% for text_url in license_reference.text_urls %}
290-
{{ text_url|urlize(target='_blank') }}
291-
{% endfor %}
292-
</td>
293-
<td>{{ license_reference.spdx_license_key }}</td>
294-
<td>{{ license_reference.spdx_url|urlize(target='_blank') }}</td>
295-
</tr>
296-
{% endfor %}
280+
{% for license_reference in license_references %}
281+
<tr id="license_{{ license_reference.key }}">
282+
<td>{{ license_reference.key }}</td>
283+
<td>{{ license_reference.short_name }}</td>
284+
<td>{{ license_reference.category }}</td>
285+
<td>{{ license_reference.owner }}</td>
286+
<td>{{ license_reference.scancode_url|urlize(target='_blank') }}</td>
287+
<td>{{ license_reference.licensedb_url|urlize(target='_blank') }}</td>
288+
<td>{{ license_reference.homepage_url|urlize(target='_blank') }}</td>
289+
<td>
290+
{% for text_url in license_reference.text_urls %}
291+
{{ text_url|urlize(target='_blank') }}
292+
{% endfor %}
293+
</td>
294+
<td>{{ license_reference.spdx_license_key }}</td>
295+
<td>{{ license_reference.spdx_url|urlize(target='_blank') }}</td>
296+
</tr>
297+
{% endfor %}
297298
</tbody>
298299
</table>
299300
{% endif %}

tests/scancode/data/help/help.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ Options:
6161
--cyclonedx-xml FILE Write scan output in CycloneDX XML format to FILE.
6262
--spdx-rdf FILE Write scan output as SPDX RDF to FILE.
6363
--spdx-tv FILE Write scan output as SPDX Tag/Value to FILE.
64-
--html-app FILE (DEPRECATED: use the ScanCode Workbench app instead )
65-
Write scan output as a mini HTML application to FILE.
6664

6765
output filters:
6866
--ignore-author <pattern> Ignore a file (and all its findings) if an

0 commit comments

Comments
 (0)