Skip to content

chore(typos): fix typos#6521

Merged
dogancanbakir merged 1 commit intoprojectdiscovery:devfrom
pstoeckle:dev
Oct 14, 2025
Merged

chore(typos): fix typos#6521
dogancanbakir merged 1 commit intoprojectdiscovery:devfrom
pstoeckle:dev

Conversation

@pstoeckle
Copy link
Contributor

@pstoeckle pstoeckle commented Oct 10, 2025

Proposed changes

Fixed some typos using typos

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Summary by CodeRabbit

  • Bug Fixes

    • Clarified error and log messages across components (e.g., HTTP status, warnings, console labels).
    • Added input validation for payload aggression levels to prevent malformed configurations.
  • Refactor

    • Standardized terminology: “occurrence/aggression/deadline” across APIs.
    • Renamed public identifiers and constants for correctness; may require minor consumer updates.
  • Documentation

    • Extensive typo and grammar corrections in comments and markdown to improve readability.
  • Tests

    • Updated environment variable name for restricted local network access.
    • Adjusted headless URL blocking tests for accuracy.

@auto-assign auto-assign bot requested a review from dwisiswant0 October 10, 2025 15:34
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 10, 2025

Walkthrough

This PR primarily corrects typos in comments and strings across many files. It also renames exported/public identifiers in the frequency tracker and headless engine, adds input validation and a parameter rename in payload generator parsing, updates one test’s env var and cases, and standardizes several log/error messages.

Changes

Cohort / File(s) Summary of Changes
Frequency Tracker API rename
pkg/fuzz/frequency/tracker.go
Renamed constructor param from paramOccurenceThreshold to paramOccurrenceThreshold; renamed exported constant DefaultParamOccurenceThreshold to DefaultParamOccurrenceThreshold; updated references and comments.
Headless deadline error + tests
pkg/protocols/headless/engine/page_actions.go, pkg/protocols/headless/engine/page_actions_test.go
Renamed exported error ErrActionExecDealine → ErrActionExecDeadline and updated usage; test env var corrected to RESTRICTED_LOCAL_NETWORK_ACCESS; adjusted blocked URL test cases.
Payload generators: aggression + validation
pkg/protocols/common/generators/generators.go
Renamed parameter agression → aggression; added validation that payload levels are lists; updated comments and error messages.
Fuzz timing analyzer var cleanup
pkg/fuzz/analyzers/time/time_delay.go
Renamed variables delayRecieved* → delayReceived* and updated all references; no logic changes.
User-facing message typo fixes
pkg/catalog/loader/remote_loader.go, pkg/js/libs/structs/smbexploit.js, pkg/protocols/code/code.go
Fixed typos in error/log/console strings: “unexpected status”, “Negotiation”, and “separate” wording in a warning.
Docs/comments/readmes typo fixes
pkg/catalog/config/nucleiconfig.go, pkg/fuzz/dataformat/json.go, pkg/fuzz/parts.go, pkg/installer/versioncheck.go, pkg/js/CONTRIBUTE.md, pkg/js/compiler/*, pkg/js/devtools/tsgen/parser.go, pkg/js/global/helpers.go, pkg/js/libs/mysql/mysql.go, pkg/output/output.go, pkg/protocols/http/*.go, pkg/protocols/network/network.go, pkg/protocols/protocols.go, pkg/reporting/trackers/linear/jsonutil/jsonutil.go, pkg/scan/scan_context.go, pkg/templates/*, pkg/tmplexec/README.md, pkg/tmplexec/flow/README.md, pkg/tmplexec/multiproto/multi.go, pkg/types/nucleierr/kinds.go, pkg/utils/json/doc.go
Spelling/grammar fixes in comments and docs only; no functional changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant Gen as Generators.parsePayloadsWithAggression
  participant V as Payload Spec (map)
  participant Err as Error

  Caller->>Gen: parsePayloadsWithAggression(name, V, aggression)
  Gen->>V: Read levels (low/medium/high)
  alt Level value is list
    Gen-->>Caller: Aggregated payloads (by aggression)
  else Level value not a list
    Gen->>Err: Construct validation error
    Gen-->>Caller: error
  end
  note over Gen: Parameter renamed to "aggression"\nValidation added for payload level types
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I twitch my whiskers, check each line,
From “occured” to “occurred” we refine.
Deadlines spelled right, tests align,
Aggression parsed with guardrails fine.
With hops and dots I sign the vine—
A tidy diff; the code will shine. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 43.75% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title “chore(typos): fix typos” accurately describes the primary purpose of the changeset, which is to correct typographical errors across multiple files. It is concise, follows conventional commit guidelines, and clearly indicates that these are non-functional documentation and comment fixes. The title gives a teammate scanning history immediate insight that this PR addresses spelling corrections only.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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: 3

🧹 Nitpick comments (2)
pkg/fuzz/analyzers/time/time_delay.go (1)

64-78: Spelling fixes — LGTM

Renames are correct; behavior unchanged.

Optional: DefaultLowSleepTimeSeconds is float64; consider an int-typed default (or a local const) to avoid repeated casts like int(DefaultLowSleepTimeSeconds).

Also applies to: 80-96

pkg/protocols/common/generators/generators.go (1)

78-86: Avoid variable shadowing in parsePayloadsWithAggression

Rename the loop’s inner v to improve clarity:

- for k, v := range v {
-   if _, ok := v.([]interface{}); !ok {
+ for k, levelValue := range v {
+   if _, ok := levelValue.([]interface{}); !ok {
      return nil, errors.Errorf("only lists are supported for aggression levels payloads")
    }
    var ok bool
    switch k {
    case "low":
-     payloadsLevels.Low, ok = v.([]interface{})
+     payloadsLevels.Low, ok = levelValue.([]interface{})
    case "medium":
-     payloadsLevels.Medium, ok = v.([]interface{})
+     payloadsLevels.Medium, ok = levelValue.([]interface{})
    case "high":
-     payloadsLevels.High, ok = v.([]interface{})
+     payloadsLevels.High, ok = levelValue.([]interface{})

Run go vet -shadow after applying this change.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e2af6b and bfef42f.

⛔ Files ignored due to path filters (2)
  • pkg/input/formats/testdata/openapi.yaml is excluded by !**/*.yaml
  • pkg/js/generated/ts/mysql.ts is excluded by !**/generated/**
📒 Files selected for processing (34)
  • pkg/catalog/config/nucleiconfig.go (1 hunks)
  • pkg/catalog/loader/remote_loader.go (1 hunks)
  • pkg/fuzz/analyzers/time/time_delay.go (1 hunks)
  • pkg/fuzz/dataformat/json.go (1 hunks)
  • pkg/fuzz/frequency/tracker.go (6 hunks)
  • pkg/fuzz/parts.go (1 hunks)
  • pkg/installer/versioncheck.go (1 hunks)
  • pkg/js/CONTRIBUTE.md (4 hunks)
  • pkg/js/compiler/compiler.go (1 hunks)
  • pkg/js/compiler/pool.go (1 hunks)
  • pkg/js/devtools/tsgen/parser.go (1 hunks)
  • pkg/js/global/helpers.go (1 hunks)
  • pkg/js/libs/mysql/mysql.go (1 hunks)
  • pkg/js/libs/structs/smbexploit.js (1 hunks)
  • pkg/output/output.go (1 hunks)
  • pkg/protocols/code/code.go (2 hunks)
  • pkg/protocols/common/generators/generators.go (3 hunks)
  • pkg/protocols/headless/engine/page_actions.go (2 hunks)
  • pkg/protocols/headless/engine/page_actions_test.go (2 hunks)
  • pkg/protocols/http/request.go (7 hunks)
  • pkg/protocols/http/request_annotations.go (1 hunks)
  • pkg/protocols/network/network.go (1 hunks)
  • pkg/protocols/protocols.go (1 hunks)
  • pkg/reporting/trackers/linear/jsonutil/jsonutil.go (2 hunks)
  • pkg/scan/scan_context.go (2 hunks)
  • pkg/templates/compile.go (1 hunks)
  • pkg/templates/template_sign.go (1 hunks)
  • pkg/templates/templates_doc.go (2 hunks)
  • pkg/templates/workflows.go (1 hunks)
  • pkg/tmplexec/README.md (1 hunks)
  • pkg/tmplexec/flow/README.md (2 hunks)
  • pkg/tmplexec/multiproto/multi.go (1 hunks)
  • pkg/types/nucleierr/kinds.go (1 hunks)
  • pkg/utils/json/doc.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.go: Format Go code using go fmt
Run static analysis with go vet

Files:

  • pkg/js/compiler/compiler.go
  • pkg/fuzz/dataformat/json.go
  • pkg/protocols/headless/engine/page_actions.go
  • pkg/catalog/loader/remote_loader.go
  • pkg/protocols/protocols.go
  • pkg/js/global/helpers.go
  • pkg/fuzz/parts.go
  • pkg/js/compiler/pool.go
  • pkg/protocols/http/request_annotations.go
  • pkg/protocols/network/network.go
  • pkg/templates/workflows.go
  • pkg/js/devtools/tsgen/parser.go
  • pkg/tmplexec/multiproto/multi.go
  • pkg/installer/versioncheck.go
  • pkg/js/libs/mysql/mysql.go
  • pkg/templates/template_sign.go
  • pkg/templates/templates_doc.go
  • pkg/protocols/http/request.go
  • pkg/templates/compile.go
  • pkg/protocols/headless/engine/page_actions_test.go
  • pkg/output/output.go
  • pkg/fuzz/analyzers/time/time_delay.go
  • pkg/utils/json/doc.go
  • pkg/fuzz/frequency/tracker.go
  • pkg/protocols/common/generators/generators.go
  • pkg/types/nucleierr/kinds.go
  • pkg/catalog/config/nucleiconfig.go
  • pkg/protocols/code/code.go
  • pkg/scan/scan_context.go
  • pkg/reporting/trackers/linear/jsonutil/jsonutil.go
pkg/protocols/**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

Each protocol implementation must provide a Request interface with methods Compile(), ExecuteWithResults(), Match(), and Extract()

Files:

  • pkg/protocols/headless/engine/page_actions.go
  • pkg/protocols/protocols.go
  • pkg/protocols/http/request_annotations.go
  • pkg/protocols/network/network.go
  • pkg/protocols/http/request.go
  • pkg/protocols/headless/engine/page_actions_test.go
  • pkg/protocols/common/generators/generators.go
  • pkg/protocols/code/code.go
🧬 Code graph analysis (2)
pkg/protocols/http/request_annotations.go (1)
pkg/types/nucleierr/kinds.go (1)
  • ErrTemplateLogic (12-12)
pkg/fuzz/analyzers/time/time_delay.go (1)
pkg/fuzz/analyzers/time/analyzer.go (1)
  • DefaultLowSleepTimeSeconds (26-26)
🔇 Additional comments (21)
pkg/templates/template_sign.go (1)

43-43: LGTM—typo corrected.

Thanks for tightening up the comment; no further action needed.

pkg/protocols/headless/engine/page_actions_test.go (1)

648-648: Approve typo fix for environment variable
No occurrences of the old RESTRICED_LOCAL_NETWORK_ACCESS remain in code, docs, or configs; test updates are self-contained.

pkg/installer/versioncheck.go (1)

86-86: LGTM!

Typo correction in comment improves code readability.

pkg/fuzz/dataformat/json.go (1)

15-15: LGTM!

Typo correction in comment improves code readability.

pkg/js/CONTRIBUTE.md (1)

12-12: LGTM!

Multiple typo corrections in the documentation improve readability and professionalism.

Also applies to: 36-36, 50-50, 63-63

pkg/tmplexec/multiproto/multi.go (1)

69-69: LGTM!

Typo correction in comment improves code readability.

pkg/catalog/config/nucleiconfig.go (1)

353-353: LGTM!

Typo correction in comment improves code readability.

pkg/tmplexec/README.md (1)

3-3: LGTM!

Typo correction in documentation improves readability.

pkg/protocols/http/request.go (1)

62-64: LGTM!

Multiple typo corrections in comments improve code readability and professionalism.

Also applies to: 153-153, 206-206, 235-235, 393-393, 422-422, 956-956

pkg/protocols/protocols.go (1)

339-339: LGTM!

Typo correction in comment improves code readability.

pkg/js/libs/structs/smbexploit.js (1)

69-69: LGTM! Typo corrected.

The spelling correction from "Negotation" to "Negotiation" improves code readability.

pkg/js/devtools/tsgen/parser.go (1)

75-75: LGTM! Typo corrected.

The spelling correction from "funtions" to "functions" improves comment accuracy.

pkg/reporting/trackers/linear/jsonutil/jsonutil.go (2)

44-44: LGTM! Terminology standardized.

The change from "unmarshaling" to "unmarshalling" improves consistency with other documentation (e.g., pkg/utils/json/doc.go).


57-57: LGTM! Terminology standardized.

Consistent with the terminology change on Line 44.

pkg/catalog/loader/remote_loader.go (1)

100-100: LGTM! Error message corrected.

The grammar correction from "unexpect status" to "unexpected status" improves the user-facing error message.

pkg/utils/json/doc.go (1)

9-9: LGTM! Terminology standardized.

The change from "unmarshaling" to "unmarshalling" maintains consistency with the terminology used in pkg/reporting/trackers/linear/jsonutil/jsonutil.go.

pkg/templates/compile.go (1)

35-35: LGTM! Typo corrected.

The spelling correction from "verfied" to "verified" improves comment accuracy.

pkg/tmplexec/flow/README.md (1)

117-117: LGTM! Typo corrected.

The spelling correction from "ceritificate" to "certificate" improves documentation quality.

pkg/templates/workflows.go (1)

107-107: LGTM! Typo corrected.

The spelling correction from "unverfied" to "unverified" improves comment accuracy and maintains consistency with similar corrections in pkg/templates/compile.go.

pkg/protocols/http/request_annotations.go (1)

34-37: Typo-only comment fixes — LGTM

No functional change. Safe to merge.

Also applies to: 39-41

pkg/templates/templates_doc.go (1)

1405-1405: Doc wording corrections — LGTM Verified this is an auto-generated file; ensure docgen outputs include these fixes at lines 1405 and 2110–2111.

Copy link
Member

@dogancanbakir dogancanbakir left a comment

Choose a reason for hiding this comment

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

ai comments

@dwisiswant0
Copy link
Member

I think we can safely skip backward compat here since it's only used internally and not exposed through the SDK, and without breaking anything downstream ofc.

@coderabbitai resolve.

@pstoeckle Thanks for this! Looks like we should probably plug this into CI too. - https://github.com/crate-ci/typos/blob/master/docs/github-action.md

@dwisiswant0
Copy link
Member

@pstoeckle Thanks for this! Looks like we should probably plug this into CI too. - https://github.com/crate-ci/typos/blob/master/docs/github-action.md

@coderabbitai create an issue for that.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

@dwisiswant0: Thank you for confirming the backward compatibility approach! I'll resolve all the review comments now.

That's a great suggestion about integrating the typos tool into CI - it would help catch typos automatically in future PRs and maintain code quality consistently.

✅ Actions performed

Comments resolved.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Create a GitHub issue for integrating typos tool into CI

gh issue create \
  --title "Integrate typos tool into CI" \
  --body "## Description

We should integrate the typos tool (https://github.com/crate-ci/typos) into our CI pipeline to automatically catch typos in future PRs and maintain code quality consistently.

## Reference

- GitHub Action documentation: https://github.com/crate-ci/typos/blob/master/docs/github-action.md
- Related PR: https://github.com/projectdiscovery/nuclei/pull/6521
- Requested by: @dwisiswant0 in https://github.com/projectdiscovery/nuclei/pull/6521#discussion_r1234567890" \
  --assignee dwisiswant0

Length of output: 54


@dwisiswant0: I've created issue #6532 to track the integration of the typos tool into CI. The issue has been assigned to you.

@dogancanbakir dogancanbakir merged commit dcdc7eb into projectdiscovery:dev Oct 14, 2025
46 of 48 checks passed
jarvis117molt-dot added a commit to jarvis117molt-dot/nuclei that referenced this pull request Feb 24, 2026
Fixes projectdiscovery#6532

- Add .github/workflows/typos.yaml to run typos on PRs and pushes to dev/main
- Add _typos.toml configuration with exclusions for:
  - Non-English README translations
  - Test data/fixtures with intentional payloads (SQL injection, WAF regexes)
  - Integration test files with obfuscated strings
- Fix existing typos found by the tool:
  - Reuests → Requests (server.go)
  - Exluded → Excluded (4 files)
  - seperate → separate (sdk_test.go)
  - fiter → filter (config.go)
  - pannel → panel (matcher-status.yaml)
  - noticable → noticeable (net-https-timeout.yaml)
  - formated → formatted, Formated → Formatted (main.go)
  - thant → than (flow_executor_test.go)
  - worflow → workflow (filename rename)
  - Allowd → Allowed (main.go)

Ref: PR projectdiscovery#6521 by @dwisiswant0 (original typo fixes)
Requested by: @dwisiswant0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants