Skip to content

Commit

Permalink
feat: GitHub workflow Codespell (#256)
Browse files Browse the repository at this point in the history
Signed-off-by: Vara Bonthu <[email protected]>
  • Loading branch information
vara-bonthu authored May 20, 2024
1 parent 921d9ef commit a4e7fb7
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 15 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/codespell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Codespell
uses: codespell-project/actions-codespell@v2
with:
check_filenames: true
# When using this Action in other repos, the --skip option below can be removed
skip: "*.excalidraw,*.git,*.png,*.jpg,*.svg,go.mod,go.sum"
continue-on-error: true # The PR checks will not fail, but the possible spelling issues will still be reported for review and correction
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# For more information, visit: https://pre-commit.com
# To run locally:
# 1. Install pre-commit: pip install pre-commit
# 2. Run pre-commit checks on all files: pre-commit run --all-files

repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: ["--skip=*.excalidraw,*.git,*.png,*.jpg,*.svg,go.sum,go.mod"]
2 changes: 1 addition & 1 deletion api/v1alpha1/localbuild_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
)

// ArgoPackageConfigSpec Allows for configuration of the ArgoCD Installation.
// If no fields are specified then the binary embedded resources will be used to intall ArgoCD.
// If no fields are specified then the binary embedded resources will be used to install ArgoCD.
type ArgoPackageConfigSpec struct {
// Enabled controls whether to install ArgoCD.
Enabled bool `json:"enabled,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The [package1 directory](./package1) is an example of a custom package that you
This configuration instructs idpbuilder to:

1. Create a Gitea repository.
2. Sync the contents of the [manifests](./package1/manifests) directory to the repostiory.
2. Sync the contents of the [manifests](./package1/manifests) directory to the repository.
3. Replace the `spec.Source(s).repoURL` field with the Gitea repository URL.

### Remote manifests
Expand Down
2 changes: 1 addition & 1 deletion examples/ref-implementation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ You can click on the ArgoCD Application name to see more details.

In this example, we will deploy a simple Apache Spark job through Argo Workflows.

Click on the `Create...` button on the left, then select the `Basic Argo Workflow witha Spark Job` template.
Click on the `Create...` button on the left, then select the `Basic Argo Workflow with a Spark Job` template.

![img.png](images/backstage-templates-spark.png)

Expand Down
2 changes: 1 addition & 1 deletion examples/terraform-integrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ idpbuilder create \

As you see above, this add-on to `idpbuilder` has a dependency to the [reference implementation](../ref-implementation/). This command primarily does the following:

1. Installs `fluxcd` source respository controller as an `argo` application.
1. Installs `fluxcd` source repository controller as an `argo` application.
2. Installs `tofu-controller` for managing the lifecycle of terraform deployments from your Kubernetes cluster for operations such as create, delete and update.
3. Finally, this stack add-on goes together with the work done under [backstage-terraform-integrations](https://github.com/cnoe-io/backstage-terraform-integrations/). Once the add-on is enabled, the user will need to follow the setup discussed in the [backstage-terraform-integrations](https://github.com/cnoe-io/backstage-terraform-integrations/) repo for the remainder of the configuration, and terraform integrations should work.
2 changes: 1 addition & 1 deletion pkg/cmd/create/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func getPackageCustomFile(input string) (v1alpha1.PackageCustomization, error) {
// the format should be `<package-name>:<path-to-file>`
s := strings.Split(input, ":")
if len(s) != 2 {
return v1alpha1.PackageCustomization{}, fmt.Errorf("ensure %s is formated as <package-name>:<path-to-file>", input)
return v1alpha1.PackageCustomization{}, fmt.Errorf("ensure %s is formatted as <package-name>:<path-to-file>", input)
}

paths, err := helpers.GetAbsFilePaths([]string{s[1]}, false)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/helpers/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ func ValidateKubernetesYamlFile(absPath string) error {
for i := range n {
obj := n[i]
if obj.IsNilOrEmpty() {
return fmt.Errorf("given file %s contains an invalid kubenretes manifest", absPath)
return fmt.Errorf("given file %s contains an invalid kubernetes manifest", absPath)
}
if obj.GetKind() == "" || obj.GetApiVersion() == "" {
return fmt.Errorf("given file %s contains an invalid kubenretes manifest", absPath)
return fmt.Errorf("given file %s contains an invalid kubernetes manifest", absPath)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/localbuild/argo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestGetRawInstallResources(t *testing.T) {
resourcePrefix := "# UCP ARGO INSTALL RESOURCES\n"
checkPrefix := resources[1][0:len(resourcePrefix)]
if resourcePrefix != string(checkPrefix) {
t.Fatalf("GetRawInstallResources() exptected 1 resource with prefix %q, got %q", resourcePrefix, checkPrefix)
t.Fatalf("GetRawInstallResources() expected 1 resource with prefix %q, got %q", resourcePrefix, checkPrefix)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
argoPackageConfigs:
description: |-
ArgoPackageConfigSpec Allows for configuration of the ArgoCD Installation.
If no fields are specified then the binary embedded resources will be used to intall ArgoCD.
If no fields are specified then the binary embedded resources will be used to install ArgoCD.
properties:
enabled:
description: Enabled controls whether to install ArgoCD.
Expand Down
2 changes: 1 addition & 1 deletion pkg/k8s/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func EnsureObject(ctx context.Context, kubeClient client.Client, obj client.Obje
return err
}

// hacky way to restore the GVK for the object after create corrupts it. didnt dig. not sure why?
// hacky way to restore the GVK for the object after create corrupts it. didn't dig. not sure why?
obj.GetObjectKind().SetGroupVersionKind(curObj.GroupVersionKind())
return nil
}
2 changes: 1 addition & 1 deletion pkg/kind/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (c *Cluster) Reconcile(ctx context.Context, recreate bool) error {
}

if !rightPort {
return fmt.Errorf("cant serve port %s. cluster %s is already running on a different port", c.cfg.Port, c.name)
return fmt.Errorf("can't serve port %s. cluster %s is already running on a different port", c.cfg.Port, c.name)
}

// reuse if there is no port conflict
Expand Down
4 changes: 2 additions & 2 deletions pkg/runtime/finch.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log"
)

type Conainer struct {
type Container struct {
NetworkSettings NetworkSettings `json:"NetworkSettings"`
State State `json:"State"`
}
Expand Down Expand Up @@ -59,7 +59,7 @@ func (f *FinchRuntime) ContainerWithPort(ctx context.Context, name string, port
return false, err
}

var containers []Conainer
var containers []Container
err = json.Unmarshal(stdout.Bytes(), &containers)
if err != nil {
return false, fmt.Errorf("%v: %s", err, stderr.String())
Expand Down
2 changes: 1 addition & 1 deletion pkg/runtime/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ type IRuntime interface {
// get runtime name
Name() string

// checks whether the container has the followin
// checks whether the container has the following
ContainerWithPort(ctx context.Context, name, port string) (bool, error)
}
2 changes: 1 addition & 1 deletion pkg/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestGeneratePassword(t *testing.T) {
}
}
if counts[0] != passwordLength {
t.Fatalf("password legnth incorrect")
t.Fatalf("password length incorrect")
}
if counts[1] < numSpecialChars {
t.Fatalf("min number of special chars not generated")
Expand Down

0 comments on commit a4e7fb7

Please sign in to comment.