ci: improve hlint messages

GitOrigin-RevId: 7547c2a08161989885b4e6c382c1e42cec809857
This commit is contained in:
Antoine Leblanc 2021-05-04 22:51:57 +01:00 committed by hasura-bot
parent 34fc92ea8c
commit fe22aa5407
2 changed files with 2 additions and 1 deletions

View File

@ -33,7 +33,7 @@ jobs:
run: |
CHANGED_HS_FILES=$(git diff --name-only origin/${{github.base_ref}}...${{github.sha}} -- "${{env.working-directory}}/*.hs" | xargs -i -d '\n' sh -c 'ls -d {} 2>/dev/null || true')
echo "$CHANGED_HS_FILES"
JQ_SCRIPT='.[] | "::" + (if (.severity=="Warning" or .severity=="Error") then "error" else "warning" end) + " file=\(.file),line=\(.startLine),col=\(.startColumn)::\(.severity):" + " \(.hint)%0AFound:%0A \(.from | gsub("\n";"%0A "))%0A" + try ("Perhaps:%0A " + (.to | gsub("\n";"%0A "))) catch ""'
JQ_SCRIPT='.[] | "::" + (if (.severity=="Warning" or .severity=="Error") then "error" else "warning" end) + " file=\(.file),line=\(.startLine),col=\(.startColumn)::\(.severity):" + " \(.hint)%0AFound:%0A \(.from | gsub("\n";"%0A "))%0A" + try ("Perhaps:%0A " + (.to | gsub("\n";"%0A ")) + "%0A") catch "" + try (if .note | length > 0 then "Note:%0A " + (.note | join("\n") | gsub("\n";"%0A ")) else "" end) catch ""'
if [[ "$CHANGED_HS_FILES" ]]
then
OUT=$(mktemp)

View File

@ -128,3 +128,4 @@
- package base
rules:
- warn: {lhs: "Data.Text.intercalate \", \" x", rhs: "commaSeparated x", note: "From Data.Text.Extended"}
- warn: {lhs: "Data.Text.Extended.intercalate \", \" x", rhs: "commaSeparated x"}