Skip to content

feat(autograder): shared grader_lib + 8 hygiene checks from c55 reviews#4

Open
lassebenni wants to merge 3 commits into
mainfrom
feat/autograder-improvements
Open

feat(autograder): shared grader_lib + 8 hygiene checks from c55 reviews#4
lassebenni wants to merge 3 commits into
mainfrom
feat/autograder-improvements

Conversation

@lassebenni
Copy link
Copy Markdown
Collaborator

Summary

Adds .hyf/grader_lib.sh (same shared library as week-1). Adds 8 warning checks for patterns flagged by reviewers across 6 c55 week-2 PRs.

New checks (0-pt warnings — scoring ladder unchanged):

Check c55 review pattern it catches
check_silent_zero_in_except "sets price/revenue/vat to 0 in except block — silently corrupts output" (PR #3)
check_exception_logged "I would log the error type for easier debug!" (PR #3, #5)
check_ruff F401,E302,E303 "This import isn't used anywhere" / "add new line after each function" (PR #1, #3)
check_no_print_statements Chapter mandates logging, not print()
check_no_notimplemented "please remove the NotImplementedError" (PR #3)
check_gitignore_python __pycache__/ and .env should not be committed
AI_DEBUG.md traceback "Would be good if the full traceback was pasted here"
Screenshot format .jpg gives 7/20 pts + warning; .png gives full 10/20 pts

Scoring: Task 1: 60 pts, Task 2: 20 pts, Task 3: 20 pts, passing = 60. Screenshot partial credit (7 vs 10) is the only scoring change.

Test plan

  • Run .hyf/test.sh from repo root — confirm hygiene section appears at end
  • Add = 0 in an except block in transforms.py — confirm WARN appears
  • Add an unused import — confirm ruff WARN appears
  • Submit .jpg instead of .png for screenshot — confirm WARN + 7 pts (not 10)

🤖 Generated with Claude Code

Lasse Benninga added 3 commits May 22, 2026 13:47
Same grader_lib.sh as week-1 — shared bash library with pass/fail/warn
helpers and static-analysis checks from c55 PR review analysis.

New warning checks for week-2 specific patterns:
- check_silent_zero_in_except: AST-based detection of 'x = 0' in except
  blocks (reviewer c55#3: "sets price/revenue/vat to 0 instead of skipping
  the row — silently corrupts output")
- check_exception_logged: warns when except-block log call doesn't include
  the exception variable 'e' (reviewer c55#5,#7: "log the error type!")
- check_ruff F401/E302: unused imports + missing blank lines between
  functions (c55#3,#1: "This import isn't used" / "add new line after func")
- check_no_print_statements: logging over print()
- check_no_notimplemented: stubs left in (c55#3)
- check_gitignore_python: __pycache__/ and .env ignored
- AI_DEBUG.md traceback check
- Screenshot format: 7/20 pts (warn) for .jpg, full 10/20 for .png

Scoring ladder unchanged (60/20/20, passing=60).
…t -e)

Same fix as week-1. Verified: scaffold 20/100 fail, solution 100/100 pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant