ci: integrate typos spell checker into CI pipeline#7055
ci: integrate typos spell checker into CI pipeline#7055a638011 wants to merge 2 commits intoprojectdiscovery:devfrom
Conversation
- 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 - PR Security ReviewNo security issues found 4 issues fixed in this PR Highlights
Hardening Notes
Comment |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughCorrects 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (3)
.github/workflows/typos.yamlis excluded by!**/*.yamlintegration_tests/protocols/http/matcher-status.yamlis excluded by!**/*.yamlintegration_tests/protocols/network/net-https-timeout.yamlis excluded by!**/*.yaml
📒 Files selected for processing (15)
README_CN.md_typos.tomlcmd/nuclei/main.gocmd/tmc/main.gointernal/runner/runner.gointernal/server/server.golib/config.golib/tests/sdk_test.gopkg/catalog/loader/loader.gopkg/fuzz/component/path.gopkg/model/workflow_loader.gopkg/templates/parser_stats.gopkg/templates/stats.gopkg/testutils/fuzzplayground/db.gopkg/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
Proposed Changes
Integrates the typos spell checker into the CI pipeline as requested in #6532.
What this PR does:
GitHub Actions workflow (
.github/workflows/typos.yaml): Runs typos on every push/PR todevandmainbranches using the officialcrate-ci/typosaction.Configuration (
_typos.toml): Properly configured to exclude:ot,hae,ue, etc.) and test case stringsTypo fixes across 15 source files:
fiter→filter,seperate→separate,Reuests→RequestsExludedDastTmplStats→ExcludedDastTmplStats(exported constant)formated/Formated→formatted/Formattedthant→than,noticable→noticeable,pannel→panelAllowd→Allowed,algoritmos→algorithms,brower→browsersplitted→splitParts(local variable rename in path.go)worflow_loader.go→workflow_loader.go(filename typo)Proof
Before (27 typos found):
After (clean):
Checklist
devbranch_typos.tomlexcludes false positives properly/claim #6532
Summary by CodeRabbit
Bug Fixes
-show-brower→-show-browser)New Features
-lha, -list-headless-actionto list headless actionsChores