diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 684f87e..ce8938b 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -21,6 +21,17 @@ concurrency: cancel-in-progress: true jobs: + typos-check: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v3 + - name: Check spelling with custom config file + uses: crate-ci/typos@v1.16.2 + with: + config: ./typos.toml + test: name: test strategy: diff --git a/agent/pkg/app/config.go b/agent/pkg/app/config.go index 19b41f8..73ab589 100644 --- a/agent/pkg/app/config.go +++ b/agent/pkg/app/config.go @@ -11,7 +11,7 @@ func configFromCLI(c *cli.Context) config.Config { // server cfg.Server.Dev = c.Bool(flagDev) - cfg.Server.ServerPort = c.Int(flageServerPort) + cfg.Server.ServerPort = c.Int(flagServerPort) cfg.Server.ReadTimeout = c.Duration(flagServerReadTimeout) cfg.Server.WriteTimeout = c.Duration(flagServerWriteTimeout) diff --git a/agent/pkg/app/root.go b/agent/pkg/app/root.go index e6bd2d8..871a326 100644 --- a/agent/pkg/app/root.go +++ b/agent/pkg/app/root.go @@ -21,7 +21,7 @@ const ( flagDev = "dev" // server - flageServerPort = "server-port" + flagServerPort = "server-port" flagServerReadTimeout = "server-read-timeout" flagServerWriteTimeout = "server-write-timeout" @@ -89,7 +89,7 @@ func New() App { Usage: "enable development mode", }, &cli.IntFlag{ - Name: flageServerPort, + Name: flagServerPort, Value: 8081, Usage: "port to listen on", EnvVars: []string{"MODELZ_AGENT_SERVER_PORT"}, diff --git a/agent/pkg/prom/prometheus_query.go b/agent/pkg/prom/prometheus_query.go index 0019f48..2b293bf 100644 --- a/agent/pkg/prom/prometheus_query.go +++ b/agent/pkg/prom/prometheus_query.go @@ -77,7 +77,7 @@ func (q PrometheusQuery) Fetch(query string) (*VectorQueryResponse, error) { unmarshalErr := json.Unmarshal(bytesOut, &values) if unmarshalErr != nil { - return nil, fmt.Errorf("error unmarshaling result: %s, '%s'", unmarshalErr, string(bytesOut)) + return nil, fmt.Errorf("error unmarshalling result: %s, '%s'", unmarshalErr, string(bytesOut)) } return &values, nil diff --git a/agent/pkg/runtime/util_domain.go b/agent/pkg/runtime/util_domain.go index 3fac331..bc0429a 100644 --- a/agent/pkg/runtime/util_domain.go +++ b/agent/pkg/runtime/util_domain.go @@ -11,7 +11,7 @@ const ( ) const ( - // stdLen is a standard length of uniuri string to achive ~95 bits of entropy. + // stdLen is a standard length of uniuri string to achieve ~95 bits of entropy. stdLen = 16 ) diff --git a/autoscaler/pkg/autoscaler/scaler.go b/autoscaler/pkg/autoscaler/scaler.go index cd05c00..51d3598 100644 --- a/autoscaler/pkg/autoscaler/scaler.go +++ b/autoscaler/pkg/autoscaler/scaler.go @@ -306,7 +306,7 @@ func (s *Scaler) AutoScale(interval time.Duration) { "service": service, "replicas": totalReplicas, "expectedReplicas": expectedReplicas, - "availabelReplicas": availableReplicas, + "availableReplicas": availableReplicas, "currentLoad": lc.CurrentLoad, "targetLoad": targetLoad, "zeroDuration": zeroDuration, diff --git a/autoscaler/pkg/prom/prom.go b/autoscaler/pkg/prom/prom.go index 4436544..794c590 100644 --- a/autoscaler/pkg/prom/prom.go +++ b/autoscaler/pkg/prom/prom.go @@ -64,7 +64,7 @@ func (q PrometheusQuery) Fetch(query string) (*VectorQueryResponse, error) { unmarshalErr := json.Unmarshal(bytesOut, &values) if unmarshalErr != nil { - return nil, fmt.Errorf("error unmarshaling result: %s, '%s'", unmarshalErr, string(bytesOut)) + return nil, fmt.Errorf("error unmarshalling result: %s, '%s'", unmarshalErr, string(bytesOut)) } return &values, nil diff --git a/ingress-operator/pkg/controller/v1/controller_test.go b/ingress-operator/pkg/controller/v1/controller_test.go index a38fd4b..b6ccee4 100644 --- a/ingress-operator/pkg/controller/v1/controller_test.go +++ b/ingress-operator/pkg/controller/v1/controller_test.go @@ -152,7 +152,7 @@ func Test_makeRules_Traefik_NestedPath_TrimsRegex_And_TrailingSlash(t *testing.T } } -func Test_makTLS(t *testing.T) { +func Test_makeTLS(t *testing.T) { cases := []struct { name string diff --git a/mdz/pkg/server/agentd_run.go b/mdz/pkg/server/agentd_run.go index 2bef043..9c16080 100644 --- a/mdz/pkg/server/agentd_run.go +++ b/mdz/pkg/server/agentd_run.go @@ -11,7 +11,7 @@ type agentDRunStep struct { } // TODO(gaocegege): There is still a bug, thus it cannot be used actually. -// The process wil exit after the command returns. We need to put it in systemd. +// The process will exit after the command returns. We need to put it in systemd. func (s *agentDRunStep) Run() error { fmt.Fprintf(s.options.OutputStream, "🚧 Running the agent for docker runtime...\n") cmd := exec.Command("/bin/sh", "-c", "mdz local-agent &") diff --git a/mdz/pkg/server/engine.go b/mdz/pkg/server/engine.go index 91573a3..f92ccec 100644 --- a/mdz/pkg/server/engine.go +++ b/mdz/pkg/server/engine.go @@ -116,7 +116,6 @@ func NewJoin(o Options) (*Engine, error) { return &Engine{ options: o, Steps: []Step{ - // Kill all k3s and related tools. &k3sJoinStep{ options: o, }, diff --git a/modelzetes/pkg/app/root.go b/modelzetes/pkg/app/root.go index bfef40d..e98bf5d 100644 --- a/modelzetes/pkg/app/root.go +++ b/modelzetes/pkg/app/root.go @@ -21,7 +21,7 @@ const ( flagDebug = "debug" // metrics - flageMetricsServerPort = "metrics-server-port" + flagMetricsServerPort = "metrics-server-port" // kubernetes flagMasterURL = "master-url" @@ -73,7 +73,7 @@ func New() App { EnvVars: []string{"DEBUG"}, }, &cli.IntFlag{ - Name: flageMetricsServerPort, + Name: flagMetricsServerPort, Value: 8081, Usage: "port to listen on", EnvVars: []string{"MODELZETES_SERVER_PORT"}, diff --git a/modelzetes/pkg/k8s/proxy.go b/modelzetes/pkg/k8s/proxy.go index c05b24d..e5662f8 100644 --- a/modelzetes/pkg/k8s/proxy.go +++ b/modelzetes/pkg/k8s/proxy.go @@ -109,6 +109,6 @@ func (l *FunctionLookup) verifyNamespace(name string) error { if name != "kube-system" { return nil } - // ToDo use global namepace parse and validation + // ToDo use global namespace parse and validation return fmt.Errorf("namespace not allowed") } diff --git a/typos.toml b/typos.toml new file mode 100644 index 0000000..b4298e3 --- /dev/null +++ b/typos.toml @@ -0,0 +1,5 @@ +[files] +extend-exclude = ["CHANGELOG.md", "go.mod", "go.sum"] +[default.extend-words] +requestor = "requestor" +ba = "ba"