Skip to content

ci: integrate typos spell-checker into CI pipeline#7077

Open
sirrodgepodge wants to merge 1 commit intoprojectdiscovery:devfrom
sirrodgepodge:feat/integrate-typos-ci
Open

ci: integrate typos spell-checker into CI pipeline#7077
sirrodgepodge wants to merge 1 commit intoprojectdiscovery:devfrom
sirrodgepodge:feat/integrate-typos-ci

Conversation

@sirrodgepodge
Copy link

@sirrodgepodge sirrodgepodge commented Mar 1, 2026

Summary

Integrates the typos spell-checking tool into the CI pipeline to automatically catch typos in future PRs.

Changes

  • New workflow (.github/workflows/typos.yaml): Runs the official crate-ci/typos GitHub Action on pushes to dev, PRs, and manual dispatch
  • Configuration (_typos.toml): Suppresses false positives from:
    • Non-English README translations (CN, ES, ID, JP, KR, PT-BR, TR)
    • Base64-encoded test data and security payloads
    • SQL injection test strings
    • Existing Go exported identifiers that cannot be renamed without breaking the API
    • CLI flag names appearing in help output
  • Typo fixes: Fixed 3 genuine typos caught by the tool:
    • PostReuestsHandlerRequestPostRequestsHandlerRequest (comment in server.go)
    • fiterfilter (comment in config.go)
    • thantthat (comment in flow_executor_test.go)

References

Summary by CodeRabbit

Release Notes

  • Chores
    • Fixed typos in code comments and documentation.
    • Enhanced typo detection configuration to improve code quality during development.

- Add new GitHub Actions workflow (.github/workflows/typos.yaml) using
  the official crate-ci/typos action to catch typos in PRs and pushes
- Add _typos.toml configuration to suppress false positives from:
  - Non-English README translations (CN, ES, ID, JP, KR, PT-BR, TR)
  - Base64-encoded test data and security payloads
  - SQL injection test strings
  - Existing Go identifiers that cannot be renamed without breaking API
  - CLI flag names in help output
- Fix genuine typos found by typos:
  - server.go: PostReuestsHandlerRequest -> PostRequestsHandlerRequest
  - config.go: fiter -> filter
  - flow_executor_test.go: thant -> that

Closes projectdiscovery#6532
Copilot AI review requested due to automatic review settings March 1, 2026 06:55
@auto-assign auto-assign bot requested a review from Mzack9999 March 1, 2026 06:55
@neo-by-projectdiscovery-dev
Copy link

neo-by-projectdiscovery-dev bot commented Mar 1, 2026

Neo Security Audit

Medium: 1

Highlights

  • Consider using Dependabot or Renovate to automatically update pinned action versions
  • The workflow correctly uses actions/checkout@v4 (pinned to major version), but crate-ci/typos@master should follow the same pattern
Medium (1)
  • GitHub Action pinned to mutable branch reference.github/workflows/typos.yaml:20
    The crate-ci/typos action is pinned to @master, a mutable branch reference that can change without notice. An attacker who compromises the upstream repository could inject malicious code that would execute in this workflow.
Security Impact

GitHub Action pinned to mutable branch reference (.github/workflows/typos.yaml:20):
If the upstream crate-ci/typos repository is compromised, malicious code could execute in the CI pipeline with GITHUB_TOKEN permissions, potentially exfiltrating secrets, modifying code, or compromising the build process.

Attack Examples

GitHub Action pinned to mutable branch reference (.github/workflows/typos.yaml:20):

1. Attacker compromises crate-ci/typos repository
2. Attacker pushes malicious code to master branch
3. Next workflow run pulls malicious code
4. Malicious code executes with workflow permissions
Suggested Fixes

GitHub Action pinned to mutable branch reference (.github/workflows/typos.yaml:20):

Pin to a specific commit SHA or immutable tag version:
- uses: crate-ci/typos@v1.28.3
or
- uses: crate-ci/typos@7ad296c10fa701265c8dbf73d4d2a450cd0e9fac
Hardening Notes
  • Consider using Dependabot or Renovate to automatically update pinned action versions
  • The workflow correctly uses actions/checkout@v4 (pinned to major version), but crate-ci/typos@master should follow the same pattern

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 1, 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 73507cd and f8df0e2.

⛔ Files ignored due to path filters (1)
  • .github/workflows/typos.yaml is excluded by !**/*.yaml
📒 Files selected for processing (4)
  • _typos.toml
  • internal/server/server.go
  • lib/config.go
  • pkg/tmplexec/flow/flow_executor_test.go

Walkthrough

This PR adds a typos tool configuration file with exclusion patterns and word mappings, and fixes four minor typos in code comments across three existing files. The changes support automated typo detection in the CI pipeline.

Changes

Cohort / File(s) Summary
Typos Tool Configuration
_typos.toml
New configuration file for the typos checker with extend-exclude paths (READMEs, test data, vendor directory) and default.extend-words mappings for misspellings, CLI fragments, test identifiers, and encoded data patterns.
Comment Corrections
internal/server/server.go, lib/config.go, pkg/tmplexec/flow/flow_executor_test.go
Minor documentation comment typo fixes: "PostReuestsHandlerRequest" → "PostRequestsHandlerRequest", "fiter by author" → "filter by author", "thant dns request" → "that dns request".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hop, hop—typos be gone!
In CI they'll be caught at dawn,
Config files now guard the way,
Spelling errors won't stay! 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly and specifically describes the main change: integrating a typos spell-checker into the CI pipeline, which matches the PR's primary objective.
Linked Issues check ✅ Passed The PR fully addresses all coding requirements from issue #6532: integrates the typos tool into CI, adds configuration to suppress false positives, and fixes identified typos.
Out of Scope Changes check ✅ Passed All changes are directly related to integrating the typos spell-checker into CI and fixing typos; no out-of-scope modifications are present.

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

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 GitHub Action pinned to mutable branch reference (CWE-829) — The crate-ci/typos action is pinned to @master, a mutable branch reference that can change without notice. An attacker who compromises the upstream repository could inject malicious code that would execute in this workflow.

Attack Example
1. Attacker compromises crate-ci/typos repository
2. Attacker pushes malicious code to master branch
3. Next workflow run pulls malicious code
4. Malicious code executes with workflow permissions
Suggested Fix
Pin to a specific commit SHA or immutable tag version:
- uses: crate-ci/typos@v1.28.3
or
- uses: crate-ci/typos@7ad296c10fa701265c8dbf73d4d2a450cd0e9fac

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Integrates the typos spell-checker into the GitHub Actions CI pipeline and adds repository-level configuration to reduce false positives, along with a few typo fixes in comments.

Changes:

  • Added a new GitHub Actions workflow to run typos on pushes to dev, PRs, and manual dispatch.
  • Added _typos.toml to exclude known-noisy paths and allow known/intentional words.
  • Fixed a few comment typos in Go source/test files.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/typos.yaml Adds CI job to run typos on pushes/PRs.
_typos.toml Configures exclusions and allowed words to suppress false positives.
internal/server/server.go Fixes a typo in a type comment.
lib/config.go Fixes a typo in a struct field comment.
pkg/tmplexec/flow/flow_executor_test.go Fixes a typo in a test comment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if: ${{ !endsWith(github.actor, '[bot]') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/checkout is pinned to v4 here, but the rest of the repository’s workflows use actions/checkout@v6. Aligning on the same major version reduces drift and avoids subtle CI differences between workflows.

Suggested change
- uses: actions/checkout@v4
- uses: actions/checkout@v6

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using crate-ci/typos@master makes the workflow depend on a moving branch, which is a supply-chain risk and can cause unexpected CI breakages. Pin the action to a stable release tag (or, ideally, a commit SHA) instead.

Suggested change
- uses: crate-ci/typos@master
- uses: crate-ci/typos@v1.16.26

Copilot uses AI. Check for mistakes.
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

2 participants