18 lines
472 B
Bash
Executable File
18 lines
472 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -uo pipefail
|
|
|
|
cd "$(dirname "$0")/.." || exit 1
|
|
|
|
emmylua_check --output-format=json . 2> >(grep -v '^Check finished$' >&2) \
|
|
| jq -r '
|
|
.[]
|
|
| .file as $f
|
|
| .diagnostics[]
|
|
| "\($f):\(.range.start.line + 1):\(.range.start.character + 1)"
|
|
+ ": \(["error","warning","info","hint"][.severity-1])"
|
|
+ ": \(.message | rtrimstr(" ")) [\(.code)]"
|
|
' \
|
|
| sed "s|^$PWD/||"
|
|
|
|
exit "${PIPESTATUS[0]}"
|