Files
docker-docs/.vale-rdjsonl.tmpl
2025-07-16 15:13:38 +02:00

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 -}}