typos/docker/format_gh.sh
Ed Page a950dd27ff refactor(gh): Pull out formatter
This makes for easier local testing.
2022-06-22 12:16:12 -05:00

9 lines
274 B
Bash
Executable file

#!/bin/bash
set -eu
grep '"type":"typo"' |
jq --sort-keys --raw-output '"::warning file=\(.path),line=\(.line_num),col=\(.byte_offset)::\"\(.typo)\" should be \"" + (.corrections // [] | join("\" or \"") + "\".")' |
while IFS= read -r line; do
echo "$line"
done