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..574a67c15e --- /dev/null +++ b/_typos.toml @@ -0,0 +1,70 @@ +[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/", + "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" + +# 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" +Splitted = "Splitted" +splitted = "splitted" +Formated = "Formated" +formated = "formated" +Allowd = "Allowd" + +# Domain-specific terms (security / networking) +SELEC = "SELEC" +IST = "IST" + +# Partial words inside compound tokens (e.g., JSONL(ines)) +ines = "ines" +ine = "ine" 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)