{# SPDX-FileCopyrightText: © 2021 Sarita Singh SPDX-License-Identifier: GPL-2.0-only ScanCode has no plugin for custom template but it has a builtin to write scan results using a custom template. @see https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_format_scan_output.html#custom-output-format #} { "licenses": [ {%- if licenses -%} {%- for key, license in licenses.items() -%} { "key": "{{ license.spdx_license_key }}", "score": {{ license.score }}, "name": "{{ license.name }}", "text_url": "{{ license.text_url }}", "start_line": {{ license.start_line }}, "matched_text": {{ license.matched_text|tojson }} } {%- if loop.nextitem and not loop.lastitem -%},{%- endif -%} {%- endfor -%} {%- endif -%} ], "copyrights": [ {%- if files.license_copyright -%} {%- for path, data in files.license_copyright.items() -%} {%- for row in data -%} {%- if row.what != 'license' -%} { "value": {{ row.value|tojson }}, "start": {{ row.start }} } {%- endif -%} {%- endfor -%} {%- if loop.nextitem and not loop.lastitem -%},{%- endif -%} {%- endfor -%} {%- endif -%} ], "holders": [ {%- if files.infos -%} {%- for path, row in files.infos.items() -%} {%- if row.holders -%} {%- for data in row.holders -%} { "value": {{ data.value|tojson }}, "start": {{ data.start_line }} } {%- if loop.nextitem and not loop.lastitem -%},{%- endif -%} {%- endfor -%} {%- endif -%} {%- endfor -%} {%- endif -%} ] }