mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-09-11 10:46:25 +03:00
ci: improve hlint messages
GitOrigin-RevId: 7547c2a08161989885b4e6c382c1e42cec809857
This commit is contained in:
parent
34fc92ea8c
commit
fe22aa5407
2
.github/workflows/hlint.yml
vendored
2
.github/workflows/hlint.yml
vendored
@ -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)
|
||||
|
@ -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"}
|
||||
|
Loading…
Reference in New Issue
Block a user