Skip to content

ci: integrate typos spell checker into CI workflow#7158

Merged
Mzack9999 merged 3 commits intoprojectdiscovery:devfrom
telewin95:feat/add-typos-ci
Mar 19, 2026
Merged

ci: integrate typos spell checker into CI workflow#7158
Mzack9999 merged 3 commits intoprojectdiscovery:devfrom
telewin95:feat/add-typos-ci

Conversation

@telewin95
Copy link
Copy Markdown

@telewin95 telewin95 commented Mar 9, 2026

Proposed Changes

Integrates the typos spell-checking tool into the CI pipeline to automatically catch typos in future PRs, as requested in #6532.

What's included

  1. New CI workflow (.github/workflows/typos.yaml)

    • Runs on pushes to dev, all pull requests, and manual dispatch
    • Uses crate-ci/typos@v1.28.4 (pinned to immutable tag for supply chain security)
    • Follows the same patterns as existing workflows (concurrency groups, bot filtering)
  2. Configuration (_typos.toml)

    • Excludes non-English README translations (CN, ES, ID, JP, KR, PT-BR, TR)
    • Excludes test fixtures, WAF regex data, certificate data, and vendor directory
    • Allows intentional identifiers (MisMatched, NoopWriter, AllowdTypes from goflags)
    • Allows CLI flag short names that appear in help strings (-ot, -ue, -ine, etc.)
  3. Typo fixes — Fixed all genuine typos caught by the tool:

    • PostReuestsHandlerRequestPostRequestsHandlerRequest (comment in server.go)
    • fiterfilter (comment in config.go)
    • thantthat (comment in flow_executor_test.go)
    • seperateseparate (sdk_test.go, 3 occurrences)
    • ExludedDastTmplStatsExcludedDastTmplStats (4 files)
    • splittedsplit (local variables in path.go)
    • formatedformatted (local variables in tmc/main.go)
    • Renamed worflow_loader.goworkflow_loader.go (misspelled filename)

Proof

Beforetypos finds 185 issues:

$ typos --format brief | wc -l
     185

After — Clean run with zero findings:

$ typos --format brief
(no output, exit code 0)

Build verification — All code compiles successfully:

$ go build ./...
(no errors)

Checklist

  • PR created against the dev branch
  • All typos findings resolved (fixed or properly suppressed)
  • go build ./... passes with no errors
  • Configuration tested locally with typos CLI v1.44.0

References

/claim #6532

Summary by CodeRabbit

  • New Features

    • Added a configuration to extend/exclude identifier and word checks (typo handling).
  • Bug Fixes

    • Fixed multiple spelling and naming typos, including public request/type and stats identifiers, and CLI/help references.
  • Documentation

    • Corrected comments and messages to fix spelling and improve clarity.

Add the crate-ci/typos GitHub Action to automatically catch spelling
errors in future PRs. This includes:

- New `.github/workflows/typos.yaml` workflow that runs on pushes to
  dev, pull requests, and manual dispatch
- `_typos.toml` configuration to suppress false positives from
  non-English READMEs, test fixtures, certificate data, CLI flag
  short names, and intentional identifiers
- Fix genuine typos found by the tool:
  - `PostReuestsHandlerRequest` -> `PostRequestsHandlerRequest`
  - `fiter` -> `filter`
  - `thant` -> `that`
  - `seperate` -> `separate`
  - `ExludedDastTmplStats` -> `ExcludedDastTmplStats`
  - `splitted` -> `split` (local variables)
  - `formated` -> `formatted` (local variables)
  - Rename `worflow_loader.go` -> `workflow_loader.go`

Fixes projectdiscovery#6532
@neo-by-projectdiscovery-dev
Copy link
Copy Markdown

neo-by-projectdiscovery-dev bot commented Mar 9, 2026

🔧 Hit a snag — please try again.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fb80e24f-c39c-4d5f-bfc3-126781756dfc

📥 Commits

Reviewing files that changed from the base of the PR and between 31ba00c and 06c228d.

📒 Files selected for processing (1)
  • _typos.toml
✅ Files skipped from review due to trivial changes (1)
  • _typos.toml

Walkthrough

Adds a _typos.toml typos-tool configuration and applies multiple typo fixes: identifier and constant renames (with a deprecated alias), one exported type rename, local variable renames, and minor comment corrections. No behavioral or control-flow changes.

Changes

Cohort / File(s) Summary
Typo tool config
/_typos.toml
New typos configuration with exclusion paths, extended identifiers and words, plus type-specific extend-identifiers for .go and .md.
Exported constant rename & alias
pkg/templates/parser_stats.go, pkg/templates/stats.go
Renamed exported constant ExludedDastTmplStatsExcludedDastTmplStats; added deprecated alias ExludedDastTmplStats = ExcludedDastTmplStats; updated usages.
Exported type rename
internal/server/server.go
Renamed exported type PostReuestsHandlerRequestPostRequestsHandlerRequest (fields unchanged).
Local identifier fixes
cmd/tmc/main.go, pkg/fuzz/component/path.go
Corrected local variable names: formatedTemplateDataformattedTemplateData, isFormatedisFormatted, splittedsplit. No logic changes.
Stats reference fixes
internal/runner/runner.go, pkg/catalog/loader/loader.go
Replaced misspelled constant references with ExcludedDastTmplStats.
Comments / docs typos
lib/config.go, lib/tests/sdk_test.go, pkg/tmplexec/flow/flow_executor_test.go
Minor spelling corrections in comments and test text (e.g., "fiter"→"filter", "seperate"→"separate", "thant"→"that").

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through files both near and far,
Tucked commas, names, and words in a jar,
Constants steady, types renamed right,
A tiny config to catch typos in sight.
✨ Happy hops — code neat and light!

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'ci: integrate typos spell checker into CI workflow' accurately describes the main objective of adding a spell-checking tool to the CI pipeline, matching the primary changes in the PR.
Linked Issues check ✅ Passed All coding requirements from issue #6532 are met: typos tool integrated via GitHub Actions workflow with proper configuration, false positives suppressed via _typos.toml, and all genuine typos fixed across the codebase.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the typos integration requirement: configuration file, workflow file, and fixes for detected typos. No unrelated modifications present.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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
Copy Markdown
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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/templates/parser_stats.go`:
- Line 11: You renamed the public constant ExludedDastTmplStats to
ExcludedDastTmplStats which is a breaking change for external consumers; restore
backward compatibility by reintroducing the old exported identifier
ExludedDastTmplStats as a deprecated alias to the new ExcludedDastTmplStats (add
a comment like "Deprecated: use ExcludedDastTmplStats") so external code still
compiles while keeping the corrected constant available and documented for
release notes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a6eba4fc-a78d-4e19-b48e-1e9663d311f6

📥 Commits

Reviewing files that changed from the base of the PR and between b5cb4cc and 63e5492.

⛔ Files ignored due to path filters (1)
  • .github/workflows/typos.yaml is excluded by !**/*.yaml
📒 Files selected for processing (12)
  • _typos.toml
  • cmd/tmc/main.go
  • internal/runner/runner.go
  • internal/server/server.go
  • lib/config.go
  • lib/tests/sdk_test.go
  • pkg/catalog/loader/loader.go
  • pkg/fuzz/component/path.go
  • pkg/model/workflow_loader.go
  • pkg/templates/parser_stats.go
  • pkg/templates/stats.go
  • pkg/tmplexec/flow/flow_executor_test.go

Retain the old exported identifier as a deprecated alias pointing to
the corrected ExcludedDastTmplStats so external consumers are not broken
by the rename.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@telewin95
Copy link
Copy Markdown
Author

Fixed — added backward-compatible deprecated alias for ExludedDastTmplStats pointing to the corrected ExcludedDastTmplStats. External consumers won't break.

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.

Integrate typos tool into CI

3 participants