mirror of
https://github.com/docker/docs.git
synced 2026-03-27 06:18:55 +07:00
32 lines
777 B
Cheetah
32 lines
777 B
Cheetah
{{- /* Range over the linted files */ -}}
|
|
|
|
{{- range .Files}}
|
|
|
|
{{- $path := .Path -}}
|
|
|
|
{{- /* Range over the file's alerts */ -}}
|
|
|
|
{{- range .Alerts -}}
|
|
|
|
{{- $error := "" -}}
|
|
{{- if eq .Severity "error" -}}
|
|
{{- $error = "ERROR" -}}
|
|
{{- else if eq .Severity "warning" -}}
|
|
{{- $error = "WARNING" -}}
|
|
{{- else -}}
|
|
{{- $error = "INFO" -}}
|
|
{{- end}}
|
|
|
|
{{- /* Variables setup */ -}}
|
|
|
|
{{- $line := printf "%d" .Line -}}
|
|
{{- $col := printf "%d" (index .Span 0) -}}
|
|
{{- $check := printf "%s" .Check -}}
|
|
{{- $message := printf "%s" .Message -}}
|
|
|
|
{{- /* Output */ -}}
|
|
|
|
{"message": "[{{ $check }}] {{ $message | jsonEscape }}", "location": {"path": "{{ $path }}", "range": {"start": {"line": {{ $line }}, "column": {{ $col }}}}}, "severity": "{{ $error }}"}
|
|
{{end -}}
|
|
{{end -}}
|