Skip to content

ci: integrate typos spell checker into CI pipeline#7055

Open
a638011 wants to merge 2 commits intoprojectdiscovery:devfrom
a638011:ci/integrate-typos-checker
Open

ci: integrate typos spell checker into CI pipeline#7055
a638011 wants to merge 2 commits intoprojectdiscovery:devfrom
a638011:ci/integrate-typos-checker

Conversation

@a638011
Copy link

@a638011 a638011 commented Feb 27, 2026

Proposed Changes

Integrates the typos spell checker into the CI pipeline as requested in #6532.

What this PR does:

  1. GitHub Actions workflow (.github/workflows/typos.yaml): Runs typos on every push/PR to dev and main branches using the official crate-ci/typos action.

  2. Configuration (_typos.toml): Properly configured to exclude:

    • Non-English README translations (PT-BR, ES, TR, KR, JP, ID, CN) which contain words that look like English typos
    • Test data files with encoded/binary content
    • WAF regex patterns
    • CLI flag shorthands (ot, hae, ue, etc.) and test case strings
  3. Typo fixes across 15 source files:

    • fiterfilter, seperateseparate, ReuestsRequests
    • ExludedDastTmplStatsExcludedDastTmplStats (exported constant)
    • formated/Formatedformatted/Formatted
    • thantthan, noticablenoticeable, pannelpanel
    • AllowdAllowed, algoritmosalgorithms, browerbrowser
    • splittedsplitParts (local variable rename in path.go)
    • Renamed worflow_loader.goworkflow_loader.go (filename typo)

Proof

Before (27 typos found):

$ typos --format brief | wc -l
27

After (clean):

$ typos --format brief
(no output - all clean)

Checklist

  • PR created against the dev branch
  • typos check passes cleanly
  • All typo fixes are verified correct
  • _typos.toml excludes false positives properly

/claim #6532

Summary by CodeRabbit

  • Bug Fixes

    • Corrected CLI flag typo in docs (-show-brower-show-browser)
    • Fixed misspelled statistics identifier shown in reports
    • Various small text fixes in comments, tests, and sample content
  • New Features

    • Added new CLI flag -lha, -list-headless-action to list headless actions
  • Chores

    • Added typos-detection configuration
    • Renamed/internal naming and message clarifications for consistency

- Add GitHub Actions workflow for typos checking on push/PR to dev/main
- Add _typos.toml configuration with false positive exclusions for
  non-English READMEs, test data, WAF regexes, and CLI flag shorthands
- Fix remaining typos across the codebase:
  - fiter -> filter, seperate -> separate, Reuests -> Requests
  - Exluded -> Excluded, formated -> formatted, thant -> than
  - noticable -> noticeable, pannel -> panel, Allowd -> Allowed
  - algoritmos -> algorithms, brower -> browser
  - splitted -> splitParts (local variable rename)
- Rename worflow_loader.go -> workflow_loader.go (filename typo)
@neo-by-projectdiscovery-dev
Copy link

neo-by-projectdiscovery-dev bot commented Feb 27, 2026

Neo - PR Security Review

No security issues found

4 issues fixed in this PR

Highlights

  • Supply chain security issue resolved: GitHub Action now pinned to v1.29.10
  • Error handling improved in template formatter
  • Backward compatibility maintained for renamed exported constant
  • Comment typo corrected
Hardening Notes
  • Consider adding a permissions block to typos.yaml workflow to follow principle of least privilege (e.g., permissions: contents: read)

Comment @neo help for available commands. · Open in Neo

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 922520a and e0ac800.

⛔ Files ignored due to path filters (1)
  • .github/workflows/typos.yaml is excluded by !**/*.yaml
📒 Files selected for processing (4)
  • _typos.toml
  • cmd/tmc/main.go
  • pkg/templates/parser_stats.go
  • pkg/tmplexec/flow/flow_executor_test.go
✅ Files skipped from review due to trivial changes (1)
  • pkg/tmplexec/flow/flow_executor_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • cmd/tmc/main.go
  • _typos.toml

Walkthrough

Corrects typos and naming inconsistencies across docs and code, adds a typos-detection config, fixes an enum flag type, introduces a new README CLI flag, and renames several variables and constants for consistency. No behavioral changes to runtime logic apart from identifier/name corrections.

Changes

Cohort / File(s) Summary
Documentation & Typos Config
README_CN.md, _typos.toml
Fixed CLI flag typo (-show-brower-show-browser), added -lha, -list-headless-action, and added typos-detection config with exclusion patterns and extended words/identifiers.
Enum Flag Type
cmd/nuclei/main.go
Corrected flag registration type from goflags.AllowdTypesgoflags.AllowedTypes for scan-strategy enum.
Public Constants / Stats
pkg/templates/parser_stats.go, pkg/templates/stats.go, pkg/catalog/loader/loader.go
Introduced ExcludedDastTmplStats, added deprecated alias ExludedDastTmplStats, and updated usages to the corrected name.
Variable Renames (logic unchanged)
cmd/tmc/main.go, pkg/fuzz/component/path.go
Renamed formatedTemplateDataformattedTemplateData, isFormatedisFormatted, splittedsplitParts, originalSplittedoriginalParts; added guarded write in tmc flow.
Comment / Test Text Fixes
internal/runner/runner.go, internal/server/server.go, lib/config.go, lib/tests/sdk_test.go, pkg/tmplexec/flow/flow_executor_test.go
Corrected several comment/test typos (e.g., ExludedExcluded, PostReuestsPostRequests, fiterfilter, seperateseparate, thantthat).
Test Data Update
pkg/testutils/fuzzplayground/db.go
Replaced Spanish dummy content "algoritmos." with English "algorithms." in seed data.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through lines, fixed letters with care,
Swapped a flag, renamed a stat, made names fair,
A config sprouted to catch typos in sight,
Now the code reads snug, tidy, and light. 🥕✨

🚥 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 accurately reflects the main objective of the PR: integrating the typos spell checker into the CI pipeline, which aligns with the primary change and the configuration file added.

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

✨ Finishing Touches
🧪 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.

Actionable comments posted: 3

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

Inline comments:
In `@cmd/tmc/main.go`:
- Around line 203-205: The write to disk for the formatted template currently
ignores errors; update the block that calls os.WriteFile(path,
[]byte(formattedTemplateData), 0644) (the code guarded by isFormatted) to
capture the returned error, handle it (log via the existing logger or return the
error from the surrounding function / exit with non-zero status), and only
assign dataString = formattedTemplateData after a successful write; also ensure
any failure surfaces to the caller instead of allowing the code to continue as
if formatting succeeded.

In `@pkg/templates/parser_stats.go`:
- Line 11: The exported constant was renamed from ExludedDastTmplStats to
ExcludedDastTmplStats which breaks downstream consumers; restore a
backward-compatible alias by reintroducing the old exported identifier
ExludedDastTmplStats as a deprecated constant (or var) that equals the new
ExcludedDastTmplStats (same string type), and add a brief comment marking it
deprecated so callers using ExludedDastTmplStats continue to compile while
encouraging migration to ExcludedDastTmplStats.

In `@pkg/tmplexec/flow/flow_executor_test.go`:
- Line 121: Update the inline comment that currently reads "verify than dns
request is executed and http is not" to correct the typo and capitalization —
change it to "verify that DNS request is executed and HTTP is not" (or at least
"verify that DNS request is executed and http is not"); locate the comment by
searching for the exact phrase "verify than dns request" in
flow_executor_test.go and make the textual fix.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9142eae and 922520a.

⛔ Files ignored due to path filters (3)
  • .github/workflows/typos.yaml is excluded by !**/*.yaml
  • integration_tests/protocols/http/matcher-status.yaml is excluded by !**/*.yaml
  • integration_tests/protocols/network/net-https-timeout.yaml is excluded by !**/*.yaml
📒 Files selected for processing (15)
  • README_CN.md
  • _typos.toml
  • cmd/nuclei/main.go
  • 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/testutils/fuzzplayground/db.go
  • pkg/tmplexec/flow/flow_executor_test.go

- Pin crate-ci/typos action to v1.29.10 (security: avoid mutable branch ref)
- Handle os.WriteFile error in tmc/main.go instead of ignoring it
- Add backward-compatible deprecated alias for ExludedDastTmplStats
- Fix comment typo: 'than' -> 'that' in flow_executor_test.go
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.

1 participant