Skip to content

unname_everywhere docstring: only the carriage return is optional, the newline is required (#66) - #67

Merged
brettheap merged 1 commit into
mainfrom
fix/unname-docstring
Sep 6, 2026
Merged

brettheap merged 1 commit into
mainfrom
fix/unname-docstring

Conversation

@brettheap

@brettheap brettheap commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Lane: xfactory-2 (xFactory-2)
Claim: #66 (claim in the issue body, 2026-09-06T03:51Z, on Brett Heap's "pick up 16 and merge on green too")

Closes #66.

Copilot's one suppressed comment on PR #65 (#63), read after the merge: the docstring of tests/test_update_shape_add.py::unname_everywhere() said the line ending is "OPTIONAL (\r?\n)". \r?\n makes only the carriage return optional — the newline is still required, and the entry is still matched as a whole line — so the sentence implied something the pattern does not accept.

One docstring passage reworded: only the \r is optional, so the whole-line match finds the entry in LF and CRLF sources alike; the newline is required. The regex, the CRLF test beside it and the behaviour are exactly as #65 left them. Nothing executable changes; README.md and AGENTS.md untouched.

Summary by Sourcery

Enhancements:

  • Clarify the unname_everywhere docstring to accurately describe the regex’s required newline and optional carriage return while documenting support for LF and CRLF sources.

…e newline is required (#66)

Copilot's suppressed comment on PR #65, read after the merge: the docstring
said the line ending is "OPTIONAL (\r?\n)", which implies the entry line might
carry no newline at all. It cannot: \r?\n makes only the carriage return
optional, and the entry is matched as a whole line. Reworded to say so and to
keep the reason the \r is optional - a core.autocrlf=true checkout has CRLF
throughout until it is renormalised. No code changes.

Lane: xfactory-2 (xFactory-2)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 6, 2026 03:55

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 9 hours and 57 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 6, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This documentation-only change corrects the unname_everywhere() docstring so it accurately explains that the existing whole-line pattern requires a newline while optionally accepting a carriage return for LF and CRLF sources; no executable behavior changes.

File-Level Changes

Change Details Files
Correct the helper’s documentation to accurately describe the existing whole-line regex and its LF/CRLF behavior.
  • Clarify that only \r is optional in \r?\n; the newline remains required.
  • Explain that whole-line matching supports entries in both LF and CRLF checkouts while leaving comments untouched.
  • Leave the regex, tests, and runtime behavior unchanged.
tests/test_update_shape_add.py

Assessment against linked issues

Issue Objective Addressed Explanation
#66 Correct the unname_everywhere() docstring to clarify that in \r?\n, only the carriage return is optional and the newline remains required for the whole-line match. ✅
#66 Leave the regex, tests, runtime behavior, and unrelated documentation unchanged. ✅

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

@sonarqubecloud

sonarqubecloud Bot commented Sep 6, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is a precise docstring correction that matches the existing regex behavior and does not alter executable code.

Pull request overview

This pull request updates the unname_everywhere() docstring in tests/test_update_shape_add.py to correctly describe the regex line-ending behavior: \r?\n makes only the carriage return optional, while the newline remains required to match and remove an entry as a whole line. This aligns the documentation with the existing regex and CRLF-focused test behavior, without changing any executable logic.

Changes:

  • Reword the unname_everywhere() docstring to clarify that \r is optional but \n is required.
  • Preserve the existing regex and CRLF test expectations while making the docstring precise about whole-line matching.
File summaries
File Description
tests/test_update_shape_add.py Clarifies the unname_everywhere() docstring to accurately describe required newline vs optional carriage return in \r?\n.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

unname_everywhere docstring: only the carriage return is optional in \r?\n, not the newline (Copilot on #65)

2 participants