Skip to content

ci: integrate typos spell checker into CI pipeline#6934

Closed
manas-io-ai wants to merge 1 commit intoprojectdiscovery:devfrom
manas-io-ai:ci/integrate-typos-checker
Closed

ci: integrate typos spell checker into CI pipeline#6934
manas-io-ai wants to merge 1 commit intoprojectdiscovery:devfrom
manas-io-ai:ci/integrate-typos-checker

Conversation

@manas-io-ai
Copy link

@manas-io-ai manas-io-ai commented Feb 18, 2026

Proposed Changes

Integrate the crate-ci/typos spell checker into the CI pipeline as a standalone workflow, addressing the revert of the original implementation (#6533) which needed configuration tweaks.

What this PR does:

  1. Adds .github/workflows/typos.yml — standalone workflow running crate-ci/typos@v1.43.5 on push/PR to dev
  2. Adds _typos.toml configuration — comprehensive config to handle false positives:
    • Excludes non-English READMEs, test fixtures, WAF regexes, embedded certificates, and encoded payloads
    • Preserves exported identifiers (ExludedDastTmplStats, PostReuestsHandlerRequest) to avoid breaking API changes
    • Handles CLI flag abbreviations (-ot, -ue, -hae, -ine, -ines) and external dependency types (goflags.AllowdTypes)
  3. Fixes actual typos found by the tool:
    • seperateseparate in lib/tests/sdk_test.go (3 occurrences)
    • fiterfilter in lib/config.go
    • thantthat in pkg/tmplexec/flow/flow_executor_test.go
    • formatedformatted in cmd/tmc/main.go (local variables + log message)
    • worflow_loader.goworkflow_loader.go (filename rename)

Design decisions:

  • Standalone workflow instead of embedding in tests.yaml — avoids blocking the test pipeline on spell checking, and was the cause of the original revert
  • Conservative approach to exported identifiers — misspelled exported names (ExludedDastTmplStats, PostReuestsHandlerRequest) are added to the ignore list rather than renamed, to avoid breaking API compatibility. These could be addressed in a separate refactoring PR.

Proof

Before (typos found):

$ typos 2>&1 | wc -l
924

After (with config + fixes):

$ typos
(no output — clean pass ✅)

Checklist

  • Pull request is created against the dev branch
  • All checks passed (typos check passes cleanly)
  • Tests verified — no functional code changes, only comment/variable name fixes and filename rename
  • Documentation added (_typos.toml config is self-documenting with comments)

/claim #6532

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fixed spelling errors in user-facing messages and code comments.
  • Chores

    • Implemented spell-checking configuration to maintain consistent code quality standards.

- Add .github/workflows/typos.yml with crate-ci/typos GitHub Action
- Add _typos.toml configuration to handle domain-specific terms
- Fix typos in comments and local variable names:
  - seperate → separate (lib/tests/sdk_test.go)
  - fiter → filter (lib/config.go)
  - thant → that (pkg/tmplexec/flow/flow_executor_test.go)
  - formated → formatted (cmd/tmc/main.go)
  - worflow_loader.go → workflow_loader.go (filename rename)
- Configure exclusions for non-English READMEs, test fixtures,
  embedded certificates, WAF regexes, and encoded payloads
- Add word/identifier exceptions for CLI flag abbreviations,
  exported API identifiers, and external dependency types

Closes projectdiscovery#6532
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

Walkthrough

The PR introduces spell-checking configuration via a new _typos.toml file and corrects multiple spelling errors across the codebase. Variable names, comments, and log messages are standardized to use correct spelling.

Changes

Cohort / File(s) Summary
Spell-checker Configuration
_typos.toml
New configuration file defining spell-checking rules, exclusions for non-English READMEs and test fixtures, and extended identifiers and words to preserve during typo checks.
Spelling Corrections
cmd/tmc/main.go
Corrects variable names (formatedTemplateData → formattedTemplateData, isFormated → isFormatted) and log message text ("formated template" → "formatted template").
Comment & Documentation Fixes
lib/config.go, lib/tests/sdk_test.go, pkg/tmplexec/flow/flow_executor_test.go
Minor spelling corrections in inline comments and test documentation (fiter → filter, seperate → separate, thant → that).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hopping through the codebase with eager paws,
We've caught those typos, every flaw!
Formatted, separated, filtered with care,
Spelling is straight, beyond compare! ✨
Now the spell-checker stands guard so true,
A typo-free future awaits you!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: integrate typos spell checker into CI pipeline' accurately describes the main change—adding a spell-checking tool to the CI workflow. It is clear, specific, and directly related to the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
_typos.toml (2)

19-20: Whole-file exclusion of integration.go silences typos outside the embedded cert.

The comment says the exclusion is for embedded base64 certificate data, but the entire file is excluded. A future typo in a comment or string literal elsewhere in that file will pass undetected.

Consider using extend-ignore-identifiers-re for the base64 blob, or enclosing just the cert block with # typos: disable / # typos: enable inline annotations if the tool supports them, to keep the rest of the file checked.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@_typos.toml` around lines 19 - 20, The whole-file exclusion for
"pkg/testutils/integration.go" hides any real typos outside the embedded base64
cert; instead, update _typos.toml to stop excluding the entire file and either
add an extend-ignore-identifiers-re pattern that matches only the long base64
blob or remove the file-level exclusion and annotate the certificate block in
pkg/testutils/integration.go with inline markers (e.g., # typos: disable / #
typos: enable) if supported; locate references to the full-file entry for
"pkg/testutils/integration.go" in _typos.toml and replace it with one of these
targeted approaches so only the cert is skipped and the rest of the file remains
linted.

31-40: Create a tracking issue for the intentionally-misspelled exported identifiers.

ExludedDastTmplStats, PostReuestsHandlerRequest, etc. are suppressed here with a plan to fix in a follow-up PR, but there's no issue linked to track it. Without an issue, these suppressions can quietly become permanent.

Would you like me to draft a GitHub issue capturing all four misspelled exported identifiers (ExludedDastTmplStats/Exluded, PostReuestsHandlerRequest/Reuests) so the rename/deprecation can be tracked explicitly?

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@_typos.toml` around lines 31 - 40, Create a GitHub tracking issue that lists
the intentionally-misspelled exported identifiers (ExludedDastTmplStats,
Exluded, PostReuestsHandlerRequest, Reuests) and the non-standard variable names
(splitted, originalSplitted, Splitted), describe the planned follow-up PR to
rename/deprecate them and include migration notes and proposed correct names;
then add the issue number reference as a comment next to the suppressed entries
in the file so future reviewers can find the tracking issue.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@_typos.toml`:
- Around line 19-20: The whole-file exclusion for "pkg/testutils/integration.go"
hides any real typos outside the embedded base64 cert; instead, update
_typos.toml to stop excluding the entire file and either add an
extend-ignore-identifiers-re pattern that matches only the long base64 blob or
remove the file-level exclusion and annotate the certificate block in
pkg/testutils/integration.go with inline markers (e.g., # typos: disable / #
typos: enable) if supported; locate references to the full-file entry for
"pkg/testutils/integration.go" in _typos.toml and replace it with one of these
targeted approaches so only the cert is skipped and the rest of the file remains
linted.
- Around line 31-40: Create a GitHub tracking issue that lists the
intentionally-misspelled exported identifiers (ExludedDastTmplStats, Exluded,
PostReuestsHandlerRequest, Reuests) and the non-standard variable names
(splitted, originalSplitted, Splitted), describe the planned follow-up PR to
rename/deprecate them and include migration notes and proposed correct names;
then add the issue number reference as a comment next to the suppressed entries
in the file so future reviewers can find the tracking issue.

@dogancanbakir
Copy link
Member

Hi, thanks for your interest in contributing! Just a heads up, we ask contributors to work on 1 active issue at a time (see).

Also, we welcome AI-assisted development, but submissions must be complete, tested, and ready to merge. Please also make sure to fill out the PR template with proof that your changes work.

We're closing this PR along with your other open submissions. Once you're ready, feel free to pick one issue to focus on and resubmit; we'd be happy to review it.

Appreciate your understanding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants