Repository navigation
Conversation
| ## Counts non-empty args (test helper for AI review). | ||
| pub function count_args(args: array) -> int | ||
| let n = 0 | ||
| let unused_x = 1 |
AI code review (advisory only — never merges)Risk: 🟡 medium count_args has an off-by-one that skips the last arg, plus an unused variable that also breaks formatting. Static: Automated review. Treat as untrusted advice: verify before acting. |
| let n = 0 | ||
| let unused_x = 1 | ||
| let i = 0 | ||
| while i < len(args) - 1 |
There was a problem hiding this comment.
major: Off-by-one vs stated intent 'Counts non-empty args': 'while i < len(args) - 1' never examines the last element, so a non-empty final arg is missed.
| while i < len(args) - 1 | |
| while i < len(args) |
| ## Counts non-empty args (test helper for AI review). | ||
| pub function count_args(args: array) -> int | ||
| let n = 0 | ||
| let unused_x = 1 |
There was a problem hiding this comment.
minor: Ground-truth lint:FAIL warning[unused-var]: variable 'unused_x' is declared but never read; same line also causes fmt:FAIL needs formatting due to 2-space indent. Remove the line.
There was a problem hiding this comment.
🟡 Changes recommended
The helper skips the final argument and returns incorrect counts when that argument is non-empty.
1 open finding
What changed in this PR
This sandbox PR adds a library helper to validate template-distributed AI code review and is intended to close unmerged.
Changes:
- Adds public
count_args(args)to count non-empty arguments.
| File | Description |
|---|---|
src/lib.alya |
Adds the argument-counting helper used for review validation. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
| let n = 0 | ||
| let unused_x = 1 | ||
| let i = 0 | ||
| while i < len(args) - 1 |

Sandbox-style verification that the template-distributed AI code review runs in a real package. Test helper with fmt/lint/bug issues; will close unmerged.