Skip to content

feat: replace codespell with typos#269

Merged
zeitlinger merged 7 commits intomainfrom
codex/replace-codespell-with-typos
May 6, 2026
Merged

feat: replace codespell with typos#269
zeitlinger merged 7 commits intomainfrom
codex/replace-codespell-with-typos

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

What changed

This replaces Flint's codespell integration with typos.

  • register typos instead of codespell
  • install it via aqua:crate-ci/typos
  • manage _typos.toml as Flint-owned config
  • run typos with --force-exclude
  • replace the old codespell fixture coverage with real typos-backed cases

Config migration

For maintained repos, Flint now does a Flint-native migration from legacy Codespell config:

  • migrate ignore-words-list
  • migrate words from .codespellignore
  • do not migrate skip
  • do not migrate check-hidden

This keeps the generated Typos config aligned with how Flint invokes the checker, rather than preserving standalone Codespell traversal behavior.

Validation

  • cargo test
  • mise run lint:fix
  • mise run lint
  • temp-repo smoke test against a maintained repo (mox) for the config migration flow

Follow-up

The smoke test exposed one remaining issue outside this PR's scope: when migrating mise.toml, a legacy pipx:codespell version string is currently preserved verbatim when rewriting to aqua:crate-ci/typos, which can produce an invalid Typos version. That should be fixed in a follow-up.

zeitlinger added 2 commits May 6, 2026 09:36
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger force-pushed the codex/replace-codespell-with-typos branch from c2ffa5f to 9ebce3a Compare May 6, 2026 09:36
zeitlinger added 2 commits May 6, 2026 09:40
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger changed the title fix: replace codespell with typos feat: replace codespell with typos May 6, 2026
zeitlinger added 2 commits May 6, 2026 10:32
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger marked this pull request as ready for review May 6, 2026 10:47
@zeitlinger zeitlinger requested a review from a team as a code owner May 6, 2026 10:47
Copilot AI review requested due to automatic review settings May 6, 2026 10:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces Flint’s spelling checker integration from codespell to typos, including updating the check registry/tooling, adding a Flint-owned _typos.toml config flow, and introducing a Flint-native migration from legacy .codespellrc / .codespellignore.

Changes:

  • Register a new typos check (invoked with --force-exclude) and remove codespell from the built-in registry.
  • Add a setup migration that converts legacy Codespell ignore-word settings into FLINT_CONFIG_DIR/_typos.toml and removes legacy files.
  • Update documentation, Renovate tracking, and test fixtures to reflect typos behavior (including fix-mode cases).

Reviewed changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/cases/typos/failure/test.toml Adds failing typos case expectations/output matching.
tests/cases/typos/failure/files/README.md Fixture file containing a known typo (teh).
tests/cases/typos/failure/files/mise.toml Installs typos in fixture toolchain.
tests/cases/typos/clean/test.toml Updates clean spelling case to run typos instead of codespell.
tests/cases/typos/clean/files/README.md Clean spelling fixture content.
tests/cases/typos/clean/files/mise.toml Installs typos in clean-case fixture.
tests/cases/typos/auto-fix/test.toml Adds typos auto-fix case expectations.
tests/cases/typos/auto-fix/files/README.md Fixture file for auto-fix (tehthe).
tests/cases/typos/auto-fix/files/mise.toml Installs typos in auto-fix fixture.
tests/cases/general/unsupported-typos-config/test.toml Adds failure case for unsupported .typos.toml config location.
tests/cases/general/unsupported-typos-config/files/mise.toml Installs typos for unsupported-config fixture.
tests/cases/general/unsupported-typos-config/files/.typos.toml Adds unsupported config file fixture.
tests/cases/general/unsupported-codespellrc-config/test.toml Adds failure case for legacy .codespellrc now treated as unsupported for typos.
tests/cases/general/unsupported-codespellrc-config/files/mise.toml Installs typos for legacy-config fixture.
tests/cases/general/unsupported-codespellrc-config/files/.codespellrc Adds legacy codespell config fixture.
tests/cases/general/unsupported-codespell-config/test.toml Removes obsolete codespell unsupported-config test.
tests/cases/general/unsupported-codespell-config/files/setup.cfg Removes obsolete codespell config fixture.
tests/cases/general/unsupported-codespell-config/files/mise.toml Removes obsolete codespell tool fixture.
tests/cases/general/init-idempotent/files/mise.toml Updates init-idempotent fixture to include typos instead of pipx:codespell.
tests/cases/general/flint-setup-obsolete-key/test.toml Updates expected stdout for additional tool key replacements/normalization messaging.
tests/cases/general/flint-setup-codespell-config-migration/test.toml Adds end-to-end fixture validating Codespell→Typos config migration output.
tests/cases/general/flint-setup-codespell-config-migration/files/mise.toml Fixture includes typos tool and FLINT_CONFIG_DIR.
tests/cases/general/flint-setup-codespell-config-migration/files/.codespellrc Legacy codespellrc fixture input for migration.
tests/cases/general/flint-setup-codespell-config-migration/files/.codespellignore Legacy ignore-words file fixture input for migration.
tests/cases/codespell/failure/test.toml Removes codespell failure fixture coverage.
tests/cases/codespell/failure/files/README.md Removes codespell failure README fixture.
tests/cases/codespell/failure/files/mise.toml Removes codespell tool fixture.
tests/cases/codespell/clean/files/README.md Removes codespell clean README fixture.
tests/cases/codespell/clean/files/mise.toml Removes codespell clean tool fixture.
tests/cases/codespell/clean/files/.github/config/.codespellrc Removes codespell config fixture.
src/registry/checks.rs Replaces codespell check registration with typos, including unsupported config detection and tool key migration list.
src/main.rs Updates embedded examples/table output to list typos instead of codespell.
src/linters/typos.rs Introduces typos init hook and Codespell→Typos config migration implementation + unit tests.
src/linters/renovate_deps/tests.rs Renames a test for correct spelling (“unparsable”).
src/linters/mod.rs Exposes new typos module.
src/linters/flint_setup.rs Ensures setup migration drift is detected even when no other errors are present.
src/init/tests.rs Updates expectations to reflect toolchain changes (typos vs pipx:codespell).
src/init/mod.rs Updates profile/category labels to mention typos.
src/init/migrations.rs Integrates typos migration into setup migration detection/application flow and message printing.
README.md Updates the registry table to list typos and removes codespell.
mise.toml Replaces pipx:codespell with typos for repo tooling.
docs/linters.md Removes codespell docs section and adds typos docs section.
default.json Updates Renovate preset tool list to include typos instead of pipx:codespell.
.github/renovate.json5 Updates Renovate config tool grouping to include typos.
.github/renovate-tracked-deps.json Removes tracking for pipx:codespell and adds tracking for typos (GitHub releases).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/linters/typos.rs Outdated
Comment thread src/linters/typos.rs
Comment thread src/registry/checks.rs
Comment thread src/linters/flint_setup.rs Outdated
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger merged commit c081c7b into main May 6, 2026
13 checks passed
@zeitlinger zeitlinger deleted the codex/replace-codespell-with-typos branch May 6, 2026 13:10
This was referenced May 8, 2026
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.

3 participants