Skip to content

fix: Integrate typos tool into CI#7011

Closed
SolariSystems wants to merge 3 commits intoprojectdiscovery:devfrom
SolariSystems:solari/fix-6532-1771884597
Closed

fix: Integrate typos tool into CI#7011
SolariSystems wants to merge 3 commits intoprojectdiscovery:devfrom
SolariSystems:solari/fix-6532-1771884597

Conversation

@SolariSystems
Copy link

@SolariSystems SolariSystems commented Feb 23, 2026

Summary

Fixes #6532

Create a new GitHub Actions workflow file that runs the crate-ci/typos tool on push and pull_request events, plus a _typos.toml configuration file to suppress false positives from domain-specific terms (security/networking jargon, variable names, test fixtures, binary/encoded data). The 'slight tweak' @dwisiswant0 mentioned refers to needing this config to avoid flagging legitimate domain terms.

Changes Made

The workflow follows established repo patterns (pinned @v1 action version, concurrency group, matching triggers), and the config provides thorough structural exclusions for generated/binary/non-English files. The known worflow filename typo is handled pragmatically.

Verification

  • Build: PASS
  • Tests: N/A
  • Lint: PASS

Summary by CodeRabbit

  • Chores

    • Expanded typo-check exclusions to ignore generated code, test data, static assets, non-English docs, acknowledgements, integration tests, test helpers, XML payloads, and fuzz data to reduce false positives.
    • Added many known-word exceptions (including a known filename typo, CLI short flags, and domain/identifier terms) to preserve intentional names during validation.
  • Style

    • Fixed several typos and minor grammar in comments and tests.

/claim #6532

@auto-assign auto-assign bot requested a review from Mzack9999 February 23, 2026 22:10
@neo-by-projectdiscovery-dev
Copy link

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

Neo - PR Security Review

No security issues found

Highlights

  • Adds GitHub Actions workflow for automated typo checking using crate-ci/typos@v1
  • Introduces _typos.toml configuration with exclusions for generated files, test data, and non-English documentation
  • Fixes comment typos in test files and library code
Hardening Notes
  • Workflow uses pinned action versions (@v6 for checkout, @v1 for typos) following security best practices
  • Configuration file contains only static exclusion patterns with no path traversal risks
  • The typos tool runs in read-only mode with no write access to repository files

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 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 70355f0 and 01ea1d8.

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

Walkthrough

Expanded _typos.toml with many exclude patterns and known-word mappings to reduce false positives; corrected small comment typos in lib/config.go, lib/tests/sdk_test.go, and pkg/tmplexec/flow/flow_executor_test.go. No exported/public API changes.

Changes

Cohort / File(s) Summary
Typos configuration
/_typos.toml
Added extensive [files] exclude patterns (generated code, test data, static assets, non‑English READMEs, acknowledgements, integration tests, test helpers, XML payloads, fuzz data, etc.) and many [default.extend-words] entries (CLI short flags, preserved identifiers, domain/partial terms, and a known filename typo worflow).
Config comment fix
lib/config.go
Fixed a typo in a comment on TemplateFilters.Authors (fiterfilter). No type or API changes.
Test comment fixes
lib/tests/sdk_test.go, pkg/tmplexec/flow/flow_executor_test.go
Minor grammar/typo corrections in test comments only; no logic or behavior changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nibbled through toml, tucked flags in rows,
Fixed a comment here, where small typo grows.
Words kept safe, excludes set just so,
Tests stay the same, the checks now flow —
A rabbit's tidy hop, gentle and slow.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Title check ❓ Inconclusive The title describes integrating a typos tool into CI, but the changeset primarily contains typo fixes and configuration updates; the actual CI workflow integration is not shown in the provided file summaries. Clarify whether the title should reflect the actual changes (typo corrections and _typos.toml config) or verify that CI workflow files are included in the changeset.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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: 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 `@_typos.toml`:
- Around line 12-18: The extend-exclude list is missing the Japanese README; add
"README_JP.md" to the extend-exclude array alongside "README_CN.md",
"README_KR.md", "README_ID.md", "README_ES.md", "README_PT-BR.md", and
"README_TR.md" so all seven translations are excluded consistently.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d771daa and f7dbcfb.

⛔ Files ignored due to path filters (1)
  • .github/workflows/typos.yaml is excluded by !**/*.yaml
📒 Files selected for processing (1)
  • _typos.toml

Add README_JP.md and several other file exclusions (embedded certs,
test fixtures, fuzz playground seeds, base64 data) that produce false
positives. Add word exceptions for existing codebase identifiers
(Exluded, Reuests, seperate, etc.) and CLI flag short names (-ot, -ue,
-hae, -fo) that typos flags as misspellings.

Verified: `typos` now exits 0 on the full repository.
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 (1)
_typos.toml (1)

53-67: Consider scoping identifier suppressions to [default.extend-identifiers].

All misspelled API names here (Splitted, Formated, seperate, pannel, noticable, etc.) are in [default.extend-words], which silences these tokens in all contexts — including future prose, comments, and string literals. The extend-words table maps word typos to their corrections; when the correction is the key, the word is always valid. By contrast, [default.extend-identifiers] maps identifier typos to their corrections; when the correction is the key, the identifier is always valid — scoped to the identifier level before word-splitting.

Moving these entries to [default.extend-identifiers] (as the official docs demonstrate with AttributeIDSupressMenu = "AttributeIDSupressMenu") would still suppress the existing broken names while allowing CI to catch the same misspellings in comments or docs going forward.

♻️ Suggested restructuring
-# Existing identifier / variable names in the codebase
-# (renaming would break API compatibility or require a separate refactor)
-Exluded = "Exluded"
-Reuests = "Reuests"
-Noo = "Noo"
-Splitted = "Splitted"
-splitted = "splitted"
-Formated = "Formated"
-formated = "formated"
-Allowd = "Allowd"
-Inactiv = "Inactiv"
-Mis = "Mis"
-seperate = "seperate"
-fiter = "fiter"
-thant = "thant"
-pannel = "pannel"
-noticable = "noticable"

Add a new section after [default.extend-words]:

[default.extend-identifiers]
# Existing identifier / variable names in the codebase
# (renaming would break API compatibility or require a separate refactor)
Exluded = "Exluded"
Reuests = "Reuests"
Noo = "Noo"
Splitted = "Splitted"
splitted = "splitted"
Formated = "Formated"
formated = "formated"
Allowd = "Allowd"
Inactiv = "Inactiv"
Mis = "Mis"
seperate = "seperate"
fiter = "fiter"
thant = "thant"
pannel = "pannel"
noticable = "noticable"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@_typos.toml` around lines 53 - 67, Move the listed misspelled API names out
of [default.extend-words] and into a new [default.extend-identifiers] table so
they only suppress identifier-level typos; specifically add an entry under
[default.extend-identifiers] containing the keys Exluded, Reuests, Noo,
Splitted, splitted, Formated, formated, Allowd, Inactiv, Mis, seperate, fiter,
thant, pannel, and noticable mapped to themselves (e.g., Exluded = "Exluded") so
these broken identifiers remain allowed in code while allowing CI to catch the
same misspellings in comments, docs, and strings.
🤖 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 53-67: Move the listed misspelled API names out of
[default.extend-words] and into a new [default.extend-identifiers] table so they
only suppress identifier-level typos; specifically add an entry under
[default.extend-identifiers] containing the keys Exluded, Reuests, Noo,
Splitted, splitted, Formated, formated, Allowd, Inactiv, Mis, seperate, fiter,
thant, pannel, and noticable mapped to themselves (e.g., Exluded = "Exluded") so
these broken identifiers remain allowed in code while allowing CI to catch the
same misspellings in comments, docs, and strings.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f7dbcfb and 9ac10dc.

📒 Files selected for processing (1)
  • _typos.toml

… typos

Remove six unnecessary entries from [default.extend-words] in _typos.toml:

- seperate, fiter, thant: fix the actual comment typos instead of
  suppressing them (sdk_test.go, config.go, flow_executor_test.go)
- pannel, noticable: only appeared in already-excluded integration_tests/
- Inactiv: dead entry, not referenced anywhere in the codebase

Keep compound-identifier sub-words (Exluded, Reuests, Splitted, Formated,
Allowd, Noo, Mis) at the word level since they appear as sub-words after
identifier splitting (e.g. ExludedDastTmplStats, originalSplitted) and
extend-identifiers only matches full identifiers.

Addresses CodeRabbit nitpick on lines 53-67.
@SolariSystems
Copy link
Author

Thanks for the review suggestion on scoping suppressions to [default.extend-identifiers].

I investigated this and unfortunately extend-identifiers won't work here — these misspelled tokens appear as sub-words inside compound identifiers after typos' word-splitting step:

  • NooNoopWriter, NooP
  • ExludedExludedDastTmplStats
  • ReuestsPostReuestsHandlerRequest
  • SplittedoriginalSplitted
  • Formated/formatedformatedTemplateData, isFormated, and also in the string "formated template"
  • AllowdAllowdTypes (from goflags)
  • MisMisMatched

Since extend-identifiers operates on full identifiers before word splitting, it would not suppress these sub-word matches. Moving them breaks CI with 20+ errors. The extend-words placement is intentional and the existing comment explains this reasoning.

@SolariSystems
Copy link
Author

Closing — the typos CI integration was already merged in #6533. Thank you.

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

1 participant