Skip to content

Commit 28d8a7e

Browse files
authored
Update docs-quality.yml
1 parent 550a666 commit 28d8a7e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/docs-quality.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,18 @@ jobs:
5050
RepeatedWords
5151
)
5252
ONLY_ARG="--only $(IFS=,; echo "${ONLY_RULES[*]}")"
53-
rules_seen="$(mktemp)"
53+
out="$(mktemp)"
5454
total=0
5555
bad=0
5656
while IFS= read -r -d '' file; do
5757
total=$((total+1))
5858
echo "::group::$file"
59-
if json_out="$(harper-cli lint $ONLY_ARG --format json "$file" 2>/dev/null)"; then
59+
if harper_out="$(harper-cli lint $ONLY_ARG "$file" 2>&1)"; then
6060
echo "no issues"
6161
else
6262
bad=$((bad+1))
63-
printf '%s' "$json_out" | python3 -c "import json,sys;d=json.load(sys.stdin);[print(l.get('rule','?'), file=sys.stderr) or print('['+l.get('rule','?')+'] '+l.get('message','')+((' -> should be: '+str(l.get('suggestions')[0])) if l.get('suggestions') else '')) for f in d for l in f.get('lints',[])]" 2>>"$rules_seen" || true
63+
echo "$harper_out"
64+
echo "$harper_out" >> "$out"
6465
fi
6566
echo "::endgroup::"
6667
done < <(
@@ -75,7 +76,7 @@ jobs:
7576
echo ""
7677
echo "### Violations by rule"
7778
echo '```'
78-
sort "$rules_seen" | uniq -c | sort -rn || true
79+
grep -oE '\[[A-Za-z]+::[A-Za-z]+\]' "$out" | sort | uniq -c | sort -rn || true
7980
echo '```'
8081
} >> "$GITHUB_STEP_SUMMARY"
8182

0 commit comments

Comments
 (0)