Skip to content

test: verify public repository OCR review - #1

Open
zehongye-gaga wants to merge 3 commits into
mainfrom
test/ocr-public-review
Open

zehongye-gaga wants to merge 3 commits into
mainfrom
test/ocr-public-review

Conversation

@zehongye-gaga

Copy link
Copy Markdown
Collaborator

Small integration test for the public repository review pipeline. Adds a six-line, non-production Python fixture with an intentional empty-input boundary bug so we can verify review findings as well as dispatch. Please leave this PR open during verification; it is not intended for production use.

@zehongye-gaga

zehongye-gaga commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

🔍 OpenCodeReview found 1 issue(s) in this PR.

  • ✅ Successfully posted inline: 1 comment(s)

Reviewed 45ab1ec..20745ca only; earlier commits in this PR were reviewed in a previous run.

Comment thread review_fixture.py

def average(values):
"""Return the arithmetic mean, or zero for an empty collection."""
return sum(values) / len(values)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
average([]) raises ZeroDivisionError because len(values) is zero, rather than returning the documented zero. Handle the empty collection before dividing.

Suggestion:

Suggested change
return sum(values) / len(values)
if len(values) == 0:
return 0
return sum(values) / len(values)

Comment thread review_fixture.py

def first_or_none(values):
"""Return the first value, or None if the collection is empty."""
return values[0]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
first_or_none([]) raises IndexError instead of returning the promised None, because index 0 is accessed unconditionally. Handle the empty sequence before indexing, and add a regression test for empty input.

Suggestion:

Suggested change
return values[0]
return values[0] if values else None

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