forked from docker/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vale-rdjsonl.tmpl
More file actions
31 lines (22 loc) · 777 Bytes
/
.vale-rdjsonl.tmpl
File metadata and controls
31 lines (22 loc) · 777 Bytes
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
{{- /* 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 -}}