Skip to content

. d Options doc wording#825

Merged
ScottBob merged 2 commits into
masterfrom
JayBazuzi/Options-doc
Jul 2, 2026
Merged

. d Options doc wording#825
ScottBob merged 2 commits into
masterfrom
JayBazuzi/Options-doc

Conversation

@JayBazuzi

@JayBazuzi JayBazuzi commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Clarify and expand the documentation for the Options API in ApprovalTests, including introductory explanation and fluent interface description.

Documentation:

  • Improve the Introduction section of the Options reference to explain the purpose of the Options object and its use across verify functions, with an illustrative snippet.
  • Clarify the description of the fluent interface used by Options, emphasizing chainable configuration and new-instance behavior.

@sourcery-ai

sourcery-ai Bot commented Jun 25, 2026

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

Reviewer's Guide

Updates the Options documentation to better explain how the shared Options object works with ApprovalTests verify functions and clarifies the description of its fluent interface, including referencing an example snippet.

Sequence diagram for using Options with verify functions

sequenceDiagram
    actor User
    participant Options as Options
    participant ApprovalTests as verify_text

    User->>Options: Options()
    User->>Options: withFileExtension(ext)
    Options-->>User: Options
    User->>Options: withReporter(reporter)
    Options-->>User: Options
    User->>verify_text: verify_text(value, options)
    verify_text-->>User: verification_result
Loading

File-Level Changes

Change Details Files
Clarified the conceptual introduction and fluent-interface description of the Options object in the ApprovalTests documentation, and linked to illustrative snippets.
  • Rewrote the introduction to explain that many verify...() functions share optional parameters via a common Options object instead of repeated overloads.
  • Emphasized that Options is accepted as an optional parameter by all verify...() functions and added a reference example snippet for basic usage.
  • Expanded the fluent interface explanation to note that each chained call returns a new Options copy that can be further configured and introduced its example snippet.
approvaltests/docs/reference/Options.md

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

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:

  • There’s a typo in the fluent interface paragraph: futher should be further.
  • Consider clarifying the phrase verify...() (e.g., verify*() or explicit examples) to avoid confusion about whether the ellipsis is literal or illustrative.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- There’s a typo in the fluent interface paragraph: `futher` should be `further`.
- Consider clarifying the phrase `verify...()` (e.g., `verify*()` or explicit examples) to avoid confusion about whether the ellipsis is literal or illustrative.

## Individual Comments

### Comment 1
<location path="approvaltests/docs/reference/Options.md" line_range="28" />
<code_context>
 ## Fluent Interface

-`Options` utilizes a fluent interface, allowing you to chain together commands. Each returned object is a new copy.
+`Options` has a "fluent" interface, allowing you to chain together commands: each returned object is a new copy of `Options` which you can configure futher. For example:

 <!-- snippet: specify_all_the_options -->
</code_context>
<issue_to_address>
**issue (typo):** Typo: "futher" should be "further".

Please correct the misspelling to "further" in this sentence.

```suggestion
`Options` has a "fluent" interface, allowing you to chain together commands: each returned object is a new copy of `Options` which you can configure further. For example:
```
</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.

Comment thread approvaltests/docs/reference/Options.md Outdated
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@JayBazuzi JayBazuzi marked this pull request as draft June 25, 2026 22:02
@ScottBob ScottBob marked this pull request as ready for review July 2, 2026 21:09
@ScottBob ScottBob merged commit 7a56a2b into master Jul 2, 2026
37 checks passed
@ScottBob ScottBob deleted the JayBazuzi/Options-doc branch July 2, 2026 21:09

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

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:

  • Consider splitting the new first sentence into two shorter sentences to improve readability (e.g., separate the idea of many verify functions from the idea of many optional parameters).
  • Use consistent code formatting for function names (verify...() vs verify()) and consider briefly explaining what the ellipsis means so readers aren’t confused about whether it’s literal syntax.
  • For the added example reference (snippet: basic_approval_with_file_extension), add a brief lead-in sentence describing what the snippet demonstrates so readers understand why it’s relevant before seeing the code.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider splitting the new first sentence into two shorter sentences to improve readability (e.g., separate the idea of many verify functions from the idea of many optional parameters).
- Use consistent code formatting for function names (`verify...()` vs `verify()`) and consider briefly explaining what the ellipsis means so readers aren’t confused about whether it’s literal syntax.
- For the added example reference (`snippet: basic_approval_with_file_extension`), add a brief lead-in sentence describing what the snippet demonstrates so readers understand why it’s relevant before seeing the code.

## Individual Comments

### Comment 1
<location path="approvaltests/docs/reference/Options.md" line_range="20" />
<code_context>

-There are many things you might want to tweak with Approval Tests. `Options` is the entry-point for many of the changes.
-It is on all `verify()` methods, as an optional parameter.
+ApprovalTests has many `verify...()` functions that need the same optional parameters, of which there are many. Instead of overloading every `verify...()` function in the same way, over and over, we put those options into an `Options` object that all the `verify...()` functions can take as an optional parameter.
+
+For example:
</code_context>
<issue_to_address>
**suggestion (typo):** Consider tightening the wording to avoid repetition and improve clarity.

The clause "that need the same optional parameters, of which there are many" is repetitive and a bit awkward. Consider something like "that share a large set of optional parameters" to keep the meaning while tightening the sentence.

```suggestion
ApprovalTests has many `verify...()` functions that share a large set of optional parameters. Instead of overloading every `verify...()` function in the same way, over and over, we put those options into an `Options` object that all the `verify...()` functions can take as an optional parameter.
```
</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.


There are many things you might want to tweak with Approval Tests. `Options` is the entry-point for many of the changes.
It is on all `verify()` methods, as an optional parameter.
ApprovalTests has many `verify...()` functions that need the same optional parameters, of which there are many. Instead of overloading every `verify...()` function in the same way, over and over, we put those options into an `Options` object that all the `verify...()` functions can take as an optional parameter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion (typo): Consider tightening the wording to avoid repetition and improve clarity.

The clause "that need the same optional parameters, of which there are many" is repetitive and a bit awkward. Consider something like "that share a large set of optional parameters" to keep the meaning while tightening the sentence.

Suggested change
ApprovalTests has many `verify...()` functions that need the same optional parameters, of which there are many. Instead of overloading every `verify...()` function in the same way, over and over, we put those options into an `Options` object that all the `verify...()` functions can take as an optional parameter.
ApprovalTests has many `verify...()` functions that share a large set of optional parameters. Instead of overloading every `verify...()` function in the same way, over and over, we put those options into an `Options` object that all the `verify...()` functions can take as an optional parameter.

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