Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/nc-review/rubric.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,14 @@ before or after, no markdown fences. Schema:
`warranted`, `duplicate`, `scope`, `changeset`, `contributing`.
- `file` / `line` — where the finding is. Omit both if it is not tied to a
specific location. Never guess a line number; omit it instead.
- `detail` — Markdown, rendered as its own block under a heading. Line breaks
and fenced code blocks are preserved, so quote the offending lines when that
makes the point faster than describing them:

```
"detail": "The captured reference is never used:\n\n```ts\nconst realRename = rename;\nrealRename; // silences unused-locals\n```\n\nSo the failure path is never exercised."
```

Lead with what is wrong, then why it matters, then what would fix it. Two or
three sentences is usually right; go longer only when quoting code earns it.
- `duplicate_of` — PR number as an integer, or `null`. Only when confident.
27 changes: 19 additions & 8 deletions .github/workflows/nc-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -483,14 +483,25 @@ jobs:
echo
fi
if [ "$(jq '.findings | length' "$V")" -gt 0 ]; then
echo "| | Area | Where | Finding |"
echo "|---|---|---|---|"
jq -r '.findings[] |
"| \(if .severity == "blocking" then "🔴" elif .severity == "important" then "🟠" else "⚪" end)"
+ " | `\(.area)`"
+ " | \(if .file then "`\(.file)\(if .line then ":\(.line)" else "" end)`" else "—" end)"
+ " | \(.detail | gsub("\n"; " ")) |"' "$V"
echo
# One block per finding rather than a table. Findings run to a
# paragraph or more, and a table cell forces all of that onto one
# line with newlines collapsed — unreadable at any width, and it
# squeezes the text into a narrow column. Blocks also let the
# detail keep its own line breaks and code formatting.
jq -r '
def icon: if . == "blocking" then "🔴"
elif . == "important" then "🟠"
else "⚪" end;
def rank: if . == "blocking" then 0
elif . == "important" then 1
else 2 end;
.findings
| sort_by(.severity | rank)
| .[]
| "**\(.severity | icon) \(.severity) · `\(.area)`"
+ (if .file then " · `\(.file)\(if .line then ":\(.line)" else "" end)`" else "" end)
+ "**\n\n\(.detail)\n"
' "$V"
fi
echo "---"
echo
Expand Down
Loading