Skip to content

Conversation

@jirehhuang
Copy link
Contributor

@jirehhuang jirehhuang commented Dec 29, 2025

Description

Minimal bug fix updating the verse count for Genesis 17 from 28 to 27, with a confirming test. Addresses #223.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run pre-commit locally prior to submission and fixed any errors/warnings.
  • I have run tests locally prior to submission and they are passing.
  • [-] I have added necessary documentation (if appropriate).
  • [-] I have updated the README (if appropriate).
  • [-] I have updated the CHANGELOG (if appropriate).
  • [-] I have updated the version number (if appropriate).
  • [-] I have updated the requirements (if appropriate).

Summary by Sourcery

Correct the stored verse count for Genesis 17 and add regression coverage to ensure the count remains accurate.

Bug Fixes:

  • Fix the verse count metadata for Genesis 17 to match the actual number of verses.

Tests:

  • Add a test verifying that counting verses for Genesis 17 returns the correct total.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 29, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the Genesis 17 verse count in the core verse metadata and adds a regression test to validate the corrected count via the public counting API.

Sequence diagram for verse count lookup using the public counting API

sequenceDiagram
    participant Test as counters_test
    participant API as counting_api
    participant Data as verse_metadata

    Test->>API: get_number_of_verses(book=GENESIS, chapter=17)
    API->>Data: lookup_verse_count(book=GENESIS, chapter=17)
    Data-->>API: verse_count=27
    API-->>Test: 27

    Note over Test,API: Regression test confirms Genesis 17 now returns 27 verses
Loading

File-Level Changes

Change Details Files
Correct Genesis 17 verse count in verse metadata.
  • Update the verse count entry for Genesis 17 from 28 to 27 in the ordered list of Genesis chapter verse counts.
  • Preserve surrounding chapter data to avoid off‑by‑one or ordering changes.
pythonbible/verses.py
Add regression test to validate Genesis 17 verse count via count_verses().
  • Introduce a dedicated test that counts verses for the reference string "Genesis 17" using bible.count_verses.
  • Assert that the returned verse count equals 27 to guard against future regressions tied to issue Number of verses in Genesis 17 #223.
tests/counters_test.py

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@jirehhuang
Copy link
Contributor Author

The scope of this PR may be expanded depending on continued discussion in #223.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The PR title/description and linked issue say Genesis 17 should have 28 verses, but the code and test enforce 27; please verify the correct verse count and align the metadata, test assertion, and PR description accordingly.
  • Instead of using # type: ignore[arg-type] in test_count_verses_genesis_17, consider constructing the expected reference type (e.g., a Reference object) so the call to bible.count_verses is type-safe without suppressing type checking.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The PR title/description and linked issue say Genesis 17 should have 28 verses, but the code and test enforce 27; please verify the correct verse count and align the metadata, test assertion, and PR description accordingly.
- Instead of using `# type: ignore[arg-type]` in `test_count_verses_genesis_17`, consider constructing the expected reference type (e.g., a `Reference` object) so the call to `bible.count_verses` is type-safe without suppressing type checking.

## Individual Comments

### Comment 1
<location> `tests/counters_test.py:215-222` </location>
<code_context>
     assert number_of_verses == 1 + 1 + (3 + 1)
+
+
+def test_count_verses_genesis_17() -> None:
+    # To address https://github.com/avendesora/pythonbible/issues/223
+    reference: str = "Genesis 17"
+
+    # Retrieve number of verses in Genesis 17
+    number_of_verses: int = bible.count_verses(reference)  # type: ignore[arg-type]
+
+    # Genesis 17 should have 27 verses
+    assert number_of_verses == 27
</code_context>

<issue_to_address>
**issue (testing):** Test expectation (27 verses) appears to contradict the PR title/description and linked issue (27 vs 28).

This test and its comment assume Genesis 17 has 27 verses, while the PR title/description and linked issue describe a change “to 27 from 28,” and the code updates metadata from 28 to 27. Please confirm the correct verse count from an authoritative source and align the test, metadata, and PR/issue text accordingly so we don’t bake an incorrect expectation into the tests or documentation.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@avendesora avendesora merged commit bbb6ad1 into avendesora:main Dec 30, 2025
6 of 7 checks passed
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.

2 participants