Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc/.vale
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-08 18:09:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-08 18:09:34 +0300
commitb5bdf6e5219b3b57107aee49ba7c103affb65dd9 (patch)
tree54c1ea8b3140d60af9a6c64867edc0a484ef7735 /doc/.vale
parent81f062b841f6062601662061850934a51e77ceea (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/.vale')
-rw-r--r--doc/.vale/vale-json.tmpl65
1 files changed, 23 insertions, 42 deletions
diff --git a/doc/.vale/vale-json.tmpl b/doc/.vale/vale-json.tmpl
index f76ca03964c..7969cb704a0 100644
--- a/doc/.vale/vale-json.tmpl
+++ b/doc/.vale/vale-json.tmpl
@@ -1,47 +1,28 @@
{{- /* Modify Vale's output https://docs.errata.ai/vale/cli#--output */ -}}
-{{- /* Keep track of our various counts */ -}}
+{{- $fileIndexes := len .Files -}}
+{{- $fileIndexes = sub $fileIndexes 1 -}}
-{{- $e := 0 -}}
-{{- $w := 0 -}}
-{{- $s := 0 -}}
-{{- $f := 0 -}}
-
-{{- /* Range over the linted files */ -}}
-
-{{- range .Files}}
-
-{{- $f = add1 $f -}}
-{{- $path := .Path -}}
-
-{{- /* Range over the file's alerts */ -}}
[
-
-{{- range $idx, $a := .Alerts -}}
-
-{{- $error := "" -}}
-{{- if eq .Severity "error" -}}
- {{- $error = "blocker" -}}
- {{- $e = add1 $e -}}
-{{- else if eq .Severity "warning" -}}
- {{- $error = "major" -}}
- {{- $w = add1 $w -}}
-{{- else -}}
- {{- $error ="info" -}}
- {{- $s = add1 $s -}}
-{{- end}}
-
-{{- /* Variables setup */ -}}
-
-{{- $path = $path -}}
-{{- $loc := printf "%d" .Line -}}
-{{- $check := printf "%s" .Check -}}
-{{- $message := printf "%s" .Message -}}
-{{- $link := printf "%s" .Link -}}
-{{- if $idx -}},{{- end -}}
-
-{{- /* Output */ -}}
-
+ {{- /* Range over the linted files */ -}}
+ {{- range $idx1, $a := .Files -}}
+ {{- $path := .Path -}}
+
+ {{/* Range over the file's alerts */}}
+ {{- range $idx2, $b := .Alerts -}}
+ {{- $error := "info" -}}
+ {{- if eq .Severity "error" -}}
+ {{- $error = "blocker" -}}
+ {{- else if eq .Severity "warning" -}}
+ {{- $error = "major" -}}
+ {{- end}}
+
+ {{- /* Variables setup */ -}}
+ {{- $loc := printf "%d" .Line -}}
+ {{- $message := printf "%s" .Message -}}
+ {{- if $idx2 -}},{{- end -}}
+
+ {{/* Output */}}
{
"description": "{{ $message }}",
"fingerprint": "{{ $path }}-{{ $loc }}",
@@ -53,6 +34,6 @@
}
}
}
-{{end -}}
-{{end -}}
+ {{- end}}{{- if (lt $idx1 $fileIndexes) -}},{{- end -}}
+ {{- end}}
]