From 27c8ddd630c8ae238505edad3fc6619b8e729143 Mon Sep 17 00:00:00 2001 From: Mark Brush Date: Mon, 23 Feb 2026 17:09:57 -0500 Subject: [PATCH 1/3] fix: Integrate typos tool into CI Addresses #6532 --- .github/workflows/typos.yaml | 19 +++++++++++++++++++ _typos.toml | 28 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/typos.yaml create mode 100644 _typos.toml diff --git a/.github/workflows/typos.yaml b/.github/workflows/typos.yaml new file mode 100644 index 0000000000..e23bca5184 --- /dev/null +++ b/.github/workflows/typos.yaml @@ -0,0 +1,19 @@ +name: 🔤 Typo Check + +on: + push: + branches: ["dev"] + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + typos: + name: "Typo Check" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: crate-ci/typos@v1 diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 0000000000..440638adf0 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,28 @@ +[files] +extend-exclude = [ + # Auto-generated + "pkg/js/generated/", + "nuclei-jsonschema.json", + # Dependencies + "go.sum", + # Binary / non-text test data + "pkg/protocols/common/helpers/deserialization/testdata/", + # Static assets + "static/", + # Non-English documentation + "README_CN.md", + "README_KR.md", + "README_ID.md", + "README_ES.md", + "README_PT-BR.md", + "README_TR.md", + # Acknowledgements (contains proper names) + "THANKS.md", + "pkg/js/THANKS.md", + # Test target lists (URLs / hostnames) + "cmd/functional-test/targets*.txt", +] + +[default.extend-words] +# Known filename typo that cannot be renamed without a separate refactor +worflow = "worflow" From 50710f1e55ca79d9594b9d6f544a52398c9a37f0 Mon Sep 17 00:00:00 2001 From: Mark Brush Date: Mon, 23 Feb 2026 17:45:39 -0500 Subject: [PATCH 2/3] fix: add missing exclusions to _typos.toml for clean CI pass Add README_JP.md and several other file exclusions (embedded certs, test fixtures, fuzz playground seeds, base64 data) that produce false positives. Add word exceptions for existing codebase identifiers (Exluded, Reuests, seperate, etc.) and CLI flag short names (-ot, -ue, -hae, -fo) that typos flags as misspellings. Verified: `typos` now exits 0 on the full repository. --- _typos.toml | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/_typos.toml b/_typos.toml index 440638adf0..39a6dc3107 100644 --- a/_typos.toml +++ b/_typos.toml @@ -7,22 +7,69 @@ extend-exclude = [ "go.sum", # Binary / non-text test data "pkg/protocols/common/helpers/deserialization/testdata/", - # Static assets + "pkg/input/formats/testdata/", + # Static assets & WAF regexes (minified / machine-generated) "static/", + "pkg/output/stats/waf/", # Non-English documentation "README_CN.md", "README_KR.md", "README_ID.md", "README_ES.md", "README_PT-BR.md", + "README_JP.md", "README_TR.md", # Acknowledgements (contains proper names) "THANKS.md", "pkg/js/THANKS.md", + # Integration test fixtures (YAML templates with intentional payloads) + "integration_tests/", # Test target lists (URLs / hostnames) "cmd/functional-test/targets*.txt", + # Encoded keys / tokens in test helpers + "cmd/integration-test/generic.go", + # Embedded certificates and base64 data + "pkg/testutils/integration.go", + # Test XML payloads (non-English content) + "pkg/operators/matchers/match_test.go", + # Embedded expressions test data (base64 tokens) + "pkg/protocols/common/expressions/expressions_test.go", + # Fuzz playground DB seeds (multi-language content) + "pkg/testutils/fuzzplayground/", ] [default.extend-words] # Known filename typo that cannot be renamed without a separate refactor worflow = "worflow" + +# CLI flag short names used throughout the codebase +ot = "ot" +ue = "ue" +hae = "hae" +fo = "fo" + +# Existing identifier / variable names in the codebase +# (renaming would break API compatibility or require a separate refactor) +Exluded = "Exluded" +Reuests = "Reuests" +Noo = "Noo" +Splitted = "Splitted" +splitted = "splitted" +Formated = "Formated" +formated = "formated" +Allowd = "Allowd" +Inactiv = "Inactiv" +Mis = "Mis" +seperate = "seperate" +fiter = "fiter" +thant = "thant" +pannel = "pannel" +noticable = "noticable" + +# Domain-specific terms (security / networking) +SELEC = "SELEC" +IST = "IST" + +# Partial words inside compound tokens (e.g., JSONL(ines)) +ines = "ines" +ine = "ine" From 01ea1d8fc125c3749ce3302bb68cdbdd92125f9d Mon Sep 17 00:00:00 2001 From: Mark Brush Date: Mon, 23 Feb 2026 18:32:32 -0500 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20tighten=20typos=20config=20=E2=80=94?= =?UTF-8?q?=20remove=20stale=20suppressions=20and=20fix=20comment=20typos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove six unnecessary entries from [default.extend-words] in _typos.toml: - seperate, fiter, thant: fix the actual comment typos instead of suppressing them (sdk_test.go, config.go, flow_executor_test.go) - pannel, noticable: only appeared in already-excluded integration_tests/ - Inactiv: dead entry, not referenced anywhere in the codebase Keep compound-identifier sub-words (Exluded, Reuests, Splitted, Formated, Allowd, Noo, Mis) at the word level since they appear as sub-words after identifier splitting (e.g. ExludedDastTmplStats, originalSplitted) and extend-identifiers only matches full identifiers. Addresses CodeRabbit nitpick on lines 53-67. --- _typos.toml | 15 +++++---------- lib/config.go | 2 +- lib/tests/sdk_test.go | 6 +++--- pkg/tmplexec/flow/flow_executor_test.go | 2 +- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/_typos.toml b/_typos.toml index 39a6dc3107..574a67c15e 100644 --- a/_typos.toml +++ b/_typos.toml @@ -48,23 +48,18 @@ ue = "ue" hae = "hae" fo = "fo" -# Existing identifier / variable names in the codebase -# (renaming would break API compatibility or require a separate refactor) +# Words inside compound identifiers — these appear as sub-words after +# identifier splitting (e.g. NoopWriter → Noo, ExludedDastTmplStats → Exluded) +# and must stay at the word level. +Noo = "Noo" +Mis = "Mis" Exluded = "Exluded" Reuests = "Reuests" -Noo = "Noo" Splitted = "Splitted" splitted = "splitted" Formated = "Formated" formated = "formated" Allowd = "Allowd" -Inactiv = "Inactiv" -Mis = "Mis" -seperate = "seperate" -fiter = "fiter" -thant = "thant" -pannel = "pannel" -noticable = "noticable" # Domain-specific terms (security / networking) SELEC = "SELEC" diff --git a/lib/config.go b/lib/config.go index e79b3310bb..b19e99faf1 100644 --- a/lib/config.go +++ b/lib/config.go @@ -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 diff --git a/lib/tests/sdk_test.go b/lib/tests/sdk_test.go index 75309bbf8e..43ed00f008 100644 --- a/lib/tests/sdk_test.go +++ b/lib/tests/sdk_test.go @@ -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") @@ -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") @@ -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") diff --git a/pkg/tmplexec/flow/flow_executor_test.go b/pkg/tmplexec/flow/flow_executor_test.go index ed983f3876..ce9ff92e09 100644 --- a/pkg/tmplexec/flow/flow_executor_test.go +++ b/pkg/tmplexec/flow/flow_executor_test.go @@ -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)