Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 🔤 Typos

on:
push:
branches: ["dev"]
pull_request:
workflow_dispatch:

jobs:
typos:
name: "Spell Check"
if: ${{ !endsWith(github.actor, '[bot]') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: crate-ci/typos@v1
with:
config: ./_typos.toml
58 changes: 58 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[files]
extend-exclude = [
# Non-English README translations
"README_CN.md",
"README_ES.md",
"README_ID.md",
"README_JP.md",
"README_KR.md",
"README_PT-BR.md",
"README_TR.md",
# WAF regex patterns
"pkg/output/stats/waf/regexes.json",
# Test fixtures with binary/encoded content
"pkg/testutils/integration.go",
"pkg/protocols/common/helpers/deserialization/testdata/",
"pkg/input/formats/testdata/",
# Integration test templates (SQL error messages, URL paths, etc.)
"integration_tests/",
]

[default]
extend-ignore-re = [
# Base64 encoded strings
"[A-Za-z0-9+/]{40,}={0,2}",
# JSONL(ines) format is intentional CLI output description
"JSONL\\(ines?\\)",
]

[default.extend-words]
# CLI flag short names
hae = "hae"
ot = "ot"
ue = "ue"
# Intentional identifiers/words
NooP = "NooP"
Noo = "Noo"
splitted = "splitted"
alo = "alo"
ser = "ser"
# Spanish content in test data
algoritmos = "algoritmos"
cliente = "cliente"
# Timezone abbreviation (Indian Standard Time)
IST = "IST"

[default.extend-identifiers]
# Existing Go identifiers (renaming would be a breaking change)
formated = "formated"
isFormated = "isFormated"
formatedTemplateData = "formatedTemplateData"
Reuests = "Reuests"
PostReuestsHandlerRequest = "PostReuestsHandlerRequest"
MisMatched = "MisMatched"
fo = "fo"
ExludedDastTmplStats = "ExludedDastTmplStats"
AllowdTypes = "AllowdTypes"
worflow = "worflow"
inFo = "inFo"
Comment on lines +46 to +58
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check that each suppressed identifier actually appears in Go source files
echo "=== Checking extend-identifiers usage ==="
for ident in formated isFormated formatedTemplateData Reuests PostReuestsHandlerRequest MisMatched fo Fo ExludedDastTmplStats AllowdTypes worflow inFo; do
  count=$(rg --type=go -w "$ident" | wc -l)
  if [ "$count" -eq 0 ]; then
    echo "$ident: NOT FOUND"
  else
    echo "$ident: found in $count occurrence(s)"
  fi
done

Repository: projectdiscovery/nuclei

Length of output: 537


Remove dead config entries for identifiers that no longer exist in the codebase.

Verification shows that three suppressed identifiers are no longer used in Go source files and should be removed from extend-identifiers:

  • Reuests = "Reuests"
  • Fo = "Fo"
  • worflow = "worflow"

These dead entries suppress typo detection for misspellings that no longer exist, creating a maintenance burden and risking future typos using the same misspellings.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@_typos.toml` around lines 48 - 61, Remove the three dead suppressed
identifiers from the extend-identifiers table in _typos.toml: delete the entries
Reuests = "Reuests", Fo = "Fo", and worflow = "worflow"; keep the other existing
identifiers untouched and then commit the updated config so the typo detector
will no longer ignore those misspellings.

2 changes: 1 addition & 1 deletion lib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type TemplateFilters struct {
ExcludeSeverities string // filter by excluding severities (accepts CSV values of info, low, medium, high, critical)
ProtocolTypes string // filter by protocol types
ExcludeProtocolTypes string // filter by excluding protocol types
Authors []string // fiter by author
Authors []string // filter by author
Tags []string // filter by tags present in template
ExcludeTags []string // filter by excluding tags present in template
IncludeTags []string // filter by including tags present in template
Expand Down
6 changes: 3 additions & 3 deletions lib/tests/sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestSimpleNuclei(t *testing.T) {
defer ne.Close()
}

// this is shared test so needs to be run as seperate process
// this is shared test so needs to be run as separate process
if env.GetEnvOrDefault("TestSimpleNuclei", false) {
// run as new process
cmd := exec.Command(os.Args[0], "-test.run=TestSimpleNuclei")
Expand Down Expand Up @@ -81,7 +81,7 @@ func TestSimpleNucleiRemote(t *testing.T) {
require.Nil(t, err)
defer ne.Close()
}
// this is shared test so needs to be run as seperate process
// this is shared test so needs to be run as separate process
if env.GetEnvOrDefault("TestSimpleNucleiRemote", false) {
cmd := exec.Command(os.Args[0], "-test.run=TestSimpleNucleiRemote")
cmd.Env = append(os.Environ(), "TestSimpleNucleiRemote=true")
Expand Down Expand Up @@ -155,7 +155,7 @@ func TestWithVarsNuclei(t *testing.T) {
require.Nil(t, err)
defer ne.Close()
}
// this is shared test so needs to be run as seperate process
// this is shared test so needs to be run as separate process
if env.GetEnvOrDefault("TestWithVarsNuclei", false) {
cmd := exec.Command(os.Args[0], "-test.run=TestWithVarsNuclei")
cmd.Env = append(os.Environ(), "TestWithVarsNuclei=true")
Expand Down
2 changes: 1 addition & 1 deletion pkg/tmplexec/flow/flow_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestFlowWithConditionNegative(t *testing.T) {

input := contextargs.NewWithInput(context.Background(), "scanme.sh")
ctx := scan.NewScanContext(context.Background(), input)
// expect no results and verify thant dns request is executed and http is not
// expect no results and verify that dns request is executed and http is not
gotresults, err := Template.Executer.Execute(ctx)
require.Nil(t, err, "could not execute template")
require.False(t, gotresults)
Expand Down