Skip to content

Preserve inline-code spelling exemptions (#294) - #302

Draft
lodyai[bot] wants to merge 1 commit into
mainfrom
issue-294-make-spelling-regenerates-typos-toml-and-drops-the-inline-code-exemption-failing-lint-on-a-clean-checkout
Draft

Preserve inline-code spelling exemptions (#294)#302
lodyai[bot] wants to merge 1 commit into
mainfrom
issue-294-make-spelling-regenerates-typos-toml-and-drops-the-inline-code-exemption-failing-lint-on-a-clean-checkout

Conversation

@lodyai

@lodyai lodyai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

This branch moves the inline-code spelling exemption into the local policy used
to generate typos.toml, preventing clean-checkout lint failures after
regeneration.

Closes #294.

Review walkthrough

Validation

  • make check-fmt: passed
  • make lint: passed
  • make typecheck: passed
  • make test: passed
  • make markdownlint: passed
  • coderabbit review --agent --base origin/main --uncommitted: zero findings

References

Summary by Sourcery

Preserve the repository’s inline-code spelling exemption in generated typos configuration.

Bug Fixes:

  • Ensure regenerated typos.toml retains the inline-code spelling ignore policy to avoid lint failures on clean checkouts.

Enhancements:

  • Document the inline-code spelling exemption directly in typos.local.toml for clearer local policy behavior.

Tests:

  • Add a regression test confirming that the rollout-generated config includes the inline-code exemption from the local policy.

Keep the inline-code pattern in the repository-local spelling policy so
regenerating `typos.toml` cannot drop it. Cover the merged configuration
with a regression test.
@sourcery-ai

sourcery-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Moves the inline-code spelling ignore pattern into the local typos policy and adds a regression test to ensure the generated config preserves this exemption.

Flow diagram for typos config generation preserving inline-code exemptions

flowchart LR
  local_policy[typos.local.toml patterns.ignore]
  generator[Config regeneration process]
  generated_config[Generated typos.toml]
  typos_linter[Typos lint run]

  local_policy --> generator
  generator --> generated_config
  generated_config --> typos_linter
Loading

File-Level Changes

Change Details Files
Ensure the generated typos configuration preserves the repository’s inline-code spelling exemption.
  • Add a test that writes a base and local typos config into a temp directory, with the local config including the inline-code ignore pattern.
  • Load the rendered config via tomllib and assert the inline-code regex is present in the extend-ignore-re section of the default policy.
scripts/tests/test_typos_rollout.py
Define the inline-code spelling ignore pattern directly in the local typos policy.
  • Replace the empty ignore patterns list with a pattern that excludes inline-code spans from spelling corrections.
  • Document the rationale for the inline-code ignore behavior in a comment above the pattern.
typos.local.toml

Assessment against linked issues

Issue Objective Addressed Explanation
#294 Ensure that regenerating typos.toml preserves the inline-code exemption pattern so that make spelling / make lint / make markdownlint pass on a clean checkout.
#294 Move the inline-code exemption into the generator’s input policy (typos.local.toml) instead of relying on hand-edits to typos.toml, so regeneration does not drop it.
#294 Add coverage to the spelling-policy tooling to ensure future regenerations of typos.toml retain the inline-code exemption and avoid regressions.

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

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.

make spelling regenerates typos.toml and drops the inline-code exemption, failing lint on a clean checkout

0 participants