-
-
Notifications
You must be signed in to change notification settings - Fork 178
Closed
Description
OK, I know for special needs --output=JSON and Go-template-based output-styles (see below) exist already, but maybe this output style may still be expanded.
For example currently one gets:
README.md:72:71:write-good.Weasel:'likely' is a weasel word!
More useful would be:
README.md:72:71: [warning] write-good.Weasel: 'likely' is a weasel word!
Or for better backwards-compatibility (the message is the last part and not structured => unlikely to be parsed):
README.md:72:71:write-good.Weasel: [warning] 'likely' is a weasel word!
A workaround is indeed possible using a Go template file:
{{- /* Very much like `vale --output=line`, but with the severities too! -}}
{{- /* See also https://docs.errata.ai/vale/cli#template-examples */ -}}
{{- range .Files}}
{{- $p := .Path -}}
{{- range .Alerts -}}
{{- printf "%s:%d:%d: [%s] %s: %s" $p .Line (index .Span 0) .Severity .Check .Message }}
{{end -}}
{{end}}