Skip to content

Instantly share code, notes, and snippets.

@sritasngh
Created June 11, 2021 04:52
Show Gist options
  • Save sritasngh/66e26bf6cd0faeed05e33e88239d0e56 to your computer and use it in GitHub Desktop.
Save sritasngh/66e26bf6cd0faeed05e33e88239d0e56 to your computer and use it in GitHub Desktop.
{
"licenses":
[
{% if licenses %}
{% for key, license in licenses.items() %}
{
"key": "{{ license.key }}",
"score": {{ license.score }},
"name": "{{ license.name }}",
"short_name": "{{ license.short_name }}",
"text_url": "{{ license.text_url }}",
"start_line": {{ license.start_line }},
"end_line": {{ license.end_line }},
"matched_length": {{ license.matched_rule.matched_length }},
"matched_text": "{{ license.matched_text }}"
}
{%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 }}",
"start": {{ row.start }},
"end": {{ row.end }}
}
{%if loop.nextitem and not loop.lastitem %},{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
],
"holders":
[
{% if files.infos %}
{% for path, row in files.infos.items() %}
{% if row.holders %}
{% for data in row.holders %}
{
"value": "{{ data.value }}",
"start_line": {{ data.start_line }},
"end_line": {{ data.end_line }}
}
{%if loop.nextitem and not loop.lastitem %},{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
],
"emails":
[
{% if files.infos %}
{% for path, row in files.infos.items() %}
{% if row.emails %}
{% for data in row.emails %}
{
"email": "{{ data.email }}",
"start_line": {{ data.start_line }},
"end_line": {{ data.end_line }}
}
{%if loop.nextitem and not loop.lastitem %},{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
],
"urls":
[
{% if files.infos %}
{% for path, row in files.infos.items() %}
{% if row.urls %}
{% for data in row.urls %}
{
"url": "{{ data.url }}",
"start_line": {{ data.start_line }},
"end_line": {{ data.end_line }}
}
{%if loop.nextitem and not loop.lastitem %},{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment