ci: integrate typos spell checker into CI pipeline#6934
ci: integrate typos spell checker into CI pipeline#6934manas-io-ai wants to merge 1 commit intoprojectdiscovery:devfrom
Conversation
- Add .github/workflows/typos.yml with crate-ci/typos GitHub Action - Add _typos.toml configuration to handle domain-specific terms - Fix typos in comments and local variable names: - seperate → separate (lib/tests/sdk_test.go) - fiter → filter (lib/config.go) - thant → that (pkg/tmplexec/flow/flow_executor_test.go) - formated → formatted (cmd/tmc/main.go) - worflow_loader.go → workflow_loader.go (filename rename) - Configure exclusions for non-English READMEs, test fixtures, embedded certificates, WAF regexes, and encoded payloads - Add word/identifier exceptions for CLI flag abbreviations, exported API identifiers, and external dependency types Closes projectdiscovery#6532
WalkthroughThe PR introduces spell-checking configuration via a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 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.
🧹 Nitpick comments (2)
_typos.toml (2)
19-20: Whole-file exclusion ofintegration.gosilences typos outside the embedded cert.The comment says the exclusion is for embedded base64 certificate data, but the entire file is excluded. A future typo in a comment or string literal elsewhere in that file will pass undetected.
Consider using
extend-ignore-identifiers-refor the base64 blob, or enclosing just the cert block with# typos: disable/# typos: enableinline annotations if the tool supports them, to keep the rest of the file checked.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@_typos.toml` around lines 19 - 20, The whole-file exclusion for "pkg/testutils/integration.go" hides any real typos outside the embedded base64 cert; instead, update _typos.toml to stop excluding the entire file and either add an extend-ignore-identifiers-re pattern that matches only the long base64 blob or remove the file-level exclusion and annotate the certificate block in pkg/testutils/integration.go with inline markers (e.g., # typos: disable / # typos: enable) if supported; locate references to the full-file entry for "pkg/testutils/integration.go" in _typos.toml and replace it with one of these targeted approaches so only the cert is skipped and the rest of the file remains linted.
31-40: Create a tracking issue for the intentionally-misspelled exported identifiers.
ExludedDastTmplStats,PostReuestsHandlerRequest, etc. are suppressed here with a plan to fix in a follow-up PR, but there's no issue linked to track it. Without an issue, these suppressions can quietly become permanent.Would you like me to draft a GitHub issue capturing all four misspelled exported identifiers (
ExludedDastTmplStats/Exluded,PostReuestsHandlerRequest/Reuests) so the rename/deprecation can be tracked explicitly?🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@_typos.toml` around lines 31 - 40, Create a GitHub tracking issue that lists the intentionally-misspelled exported identifiers (ExludedDastTmplStats, Exluded, PostReuestsHandlerRequest, Reuests) and the non-standard variable names (splitted, originalSplitted, Splitted), describe the planned follow-up PR to rename/deprecate them and include migration notes and proposed correct names; then add the issue number reference as a comment next to the suppressed entries in the file so future reviewers can find the tracking issue.
🤖 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 19-20: The whole-file exclusion for "pkg/testutils/integration.go"
hides any real typos outside the embedded base64 cert; instead, update
_typos.toml to stop excluding the entire file and either add an
extend-ignore-identifiers-re pattern that matches only the long base64 blob or
remove the file-level exclusion and annotate the certificate block in
pkg/testutils/integration.go with inline markers (e.g., # typos: disable / #
typos: enable) if supported; locate references to the full-file entry for
"pkg/testutils/integration.go" in _typos.toml and replace it with one of these
targeted approaches so only the cert is skipped and the rest of the file remains
linted.
- Around line 31-40: Create a GitHub tracking issue that lists the
intentionally-misspelled exported identifiers (ExludedDastTmplStats, Exluded,
PostReuestsHandlerRequest, Reuests) and the non-standard variable names
(splitted, originalSplitted, Splitted), describe the planned follow-up PR to
rename/deprecate them and include migration notes and proposed correct names;
then add the issue number reference as a comment next to the suppressed entries
in the file so future reviewers can find the tracking issue.
|
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! |
Proposed Changes
Integrate the crate-ci/typos spell checker into the CI pipeline as a standalone workflow, addressing the revert of the original implementation (#6533) which needed configuration tweaks.
What this PR does:
.github/workflows/typos.yml— standalone workflow runningcrate-ci/typos@v1.43.5on push/PR todev_typos.tomlconfiguration — comprehensive config to handle false positives:ExludedDastTmplStats,PostReuestsHandlerRequest) to avoid breaking API changes-ot,-ue,-hae,-ine,-ines) and external dependency types (goflags.AllowdTypes)seperate→separateinlib/tests/sdk_test.go(3 occurrences)fiter→filterinlib/config.gothant→thatinpkg/tmplexec/flow/flow_executor_test.goformated→formattedincmd/tmc/main.go(local variables + log message)worflow_loader.go→workflow_loader.go(filename rename)Design decisions:
tests.yaml— avoids blocking the test pipeline on spell checking, and was the cause of the original revertExludedDastTmplStats,PostReuestsHandlerRequest) are added to the ignore list rather than renamed, to avoid breaking API compatibility. These could be addressed in a separate refactoring PR.Proof
Before (typos found):
After (with config + fixes):
Checklist
devbranch_typos.tomlconfig is self-documenting with comments)/claim #6532
Summary by CodeRabbit
Release Notes
Bug Fixes
Chores