-
Notifications
You must be signed in to change notification settings - Fork 2
/
license-checks.tpl
45 lines (45 loc) · 1.48 KB
/
license-checks.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{{- /* Template based on https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#data-types */ -}}
[
{{- $t_first := true }}
{{- range . }}
{{- $target := .Target }}
{{- if ne .Target "OS Packages" -}}
{{- range .Licenses -}}
{{- if $t_first -}}
{{- $t_first = false -}}
{{ else -}}
,
{{- end }}
{
"type": "issue",
"check_name": "license_scanning",
"categories": [ "Security" ],
"description": {{ list .Name .PkgName .FilePath .Link | compact | join " - " | printf "%q" }},
"fingerprint": "{{ list .Name .PkgName .FilePath .Link $target | compact | join "" | sha1sum }}",
"content": {{ .PkgName | printf "%q" }},
"severity": {{ if eq .Severity "LOW" -}}
"info"
{{- else if eq .Severity "MEDIUM" -}}
"minor"
{{- else if eq .Severity "HIGH" -}}
"major"
{{- else if eq .Severity "CRITICAL" -}}
"critical"
{{- else -}}
"info"
{{- end }},
"location": {
"path": {{ if eq $target "Node.js" -}}
"package.json"
{{- else if eq $target "Python" -}}
"Pipfile"
{{- end }},
"lines": {
"begin": 0
}
}
}
{{- end -}}
{{- end}}
{{- end }}
]