Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
chore: fix typos (#128)
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <[email protected]>
  • Loading branch information
kemingy authored Aug 7, 2023
1 parent dd993ec commit 49557f2
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 13 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
config: ./typos.toml

test:
name: test
strategy:
Expand Down
2 changes: 1 addition & 1 deletion agent/pkg/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions agent/pkg/app/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
flagDev = "dev"

// server
flageServerPort = "server-port"
flagServerPort = "server-port"
flagServerReadTimeout = "server-read-timeout"
flagServerWriteTimeout = "server-write-timeout"

Expand Down Expand Up @@ -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"},
Expand Down
2 changes: 1 addition & 1 deletion agent/pkg/prom/prometheus_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion agent/pkg/runtime/util_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion autoscaler/pkg/autoscaler/scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion autoscaler/pkg/prom/prom.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ingress-operator/pkg/controller/v1/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mdz/pkg/server/agentd_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 &")
Expand Down
1 change: 0 additions & 1 deletion mdz/pkg/server/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
4 changes: 2 additions & 2 deletions modelzetes/pkg/app/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
flagDebug = "debug"

// metrics
flageMetricsServerPort = "metrics-server-port"
flagMetricsServerPort = "metrics-server-port"

// kubernetes
flagMasterURL = "master-url"
Expand Down Expand Up @@ -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"},
Expand Down
2 changes: 1 addition & 1 deletion modelzetes/pkg/k8s/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
5 changes: 5 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[files]
extend-exclude = ["CHANGELOG.md", "go.mod", "go.sum"]
[default.extend-words]
requestor = "requestor"
ba = "ba"

0 comments on commit 49557f2

Please sign in to comment.