diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 0000000000..3d700cb056 --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,16 @@ +name: 🔤 Typos + +on: + push: + branches: [dev] + pull_request: + branches: [dev] + workflow_dispatch: + +jobs: + typos: + name: Spell Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: crate-ci/typos@v1.43.5 diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 0000000000..c3e0c35b32 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,62 @@ +# Configuration for the typos spell checker +# https://github.com/crate-ci/typos + +[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", + # Test fixtures and binary/encoded data + "pkg/input/formats/testdata/*", + "pkg/protocols/common/helpers/deserialization/testdata/*", + # WAF regex patterns contain intentional fragments + "pkg/output/stats/waf/regexes.json", + # Embedded certificates (base64 data) + "pkg/testutils/integration.go", + # Integration test templates with encoded payloads + "integration_tests/fuzz/*.yaml", + "integration_tests/protocols/**/*.yaml", + # Integration test binary/encoded data + "cmd/integration-test/generic.go", +] + +[default.extend-identifiers] +# Variable/field names in code that are intentionally spelled this way +fo = "fo" +# Exported constant used across multiple files (changing would break API) +ExludedDastTmplStats = "ExludedDastTmplStats" +Exluded = "Exluded" +# Exported struct name (changing would break API) +PostReuestsHandlerRequest = "PostReuestsHandlerRequest" +Reuests = "Reuests" +# Variable names using "splitted" (non-standard but intentional) +splitted = "splitted" +originalSplitted = "originalSplitted" +Splitted = "Splitted" + +[default.extend-words] +# CLI flag abbreviations used in help text and flag definitions +ines = "ines" +ine = "ine" +hae = "hae" +ue = "ue" +ot = "ot" +# External dependency type (projectdiscovery/goflags) +Allowd = "Allowd" +# NooP is a standard abbreviation for No-Operation +Noo = "Noo" +# MisMatched is a struct field name (Mis + Matched) +Mis = "Mis" +# Test data values (XML content, severity test case, base64 fragments) +alo = "alo" +Iif = "Iif" +Fo = "Fo" +# Spanish word in fuzz playground test data +algoritmos = "algoritmos" +# SELEC appears as part of SQL keyword testing +SELEC = "SELEC" diff --git a/cmd/tmc/main.go b/cmd/tmc/main.go index fa9bc8ea5f..366b2ced3c 100644 --- a/cmd/tmc/main.go +++ b/cmd/tmc/main.go @@ -196,14 +196,14 @@ func process(opts options) error { } if opts.format { - formatedTemplateData, isFormated, err := formatTemplate(dataString) + formattedTemplateData, isFormatted, err := formatTemplate(dataString) if err != nil { gologger.Info().Label("format").Msg(logErrMsg(path, err, opts.debug, errFile)) } else { - if isFormated { - _ = os.WriteFile(path, []byte(formatedTemplateData), 0644) - dataString = formatedTemplateData - gologger.Info().Label("format").Msgf("✅ formated template: %s\n", path) + if isFormatted { + _ = os.WriteFile(path, []byte(formattedTemplateData), 0644) + dataString = formattedTemplateData + gologger.Info().Label("format").Msgf("✅ formatted template: %s\n", path) } } } 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/model/worflow_loader.go b/pkg/model/workflow_loader.go similarity index 100% rename from pkg/model/worflow_loader.go rename to pkg/model/workflow_loader.go 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)