Skip to content

Commit fb5d0f6

Browse files
authored
Add codespell CI job (netbox-community#368)
* Add codespell job * Run `codespell --skip="*.svg" --write-changes` to fix current spelling issues
1 parent 5a4c244 commit fb5d0f6

File tree

14 files changed

+29
-21
lines changed

14 files changed

+29
-21
lines changed

.github/workflows/lint.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
pull_request:
1010
permissions: read-all
1111
jobs:
12-
run:
12+
go-and-crds:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
@@ -58,3 +58,11 @@ jobs:
5858
echo "Please run make generate manifests and commit the changes."
5959
exit 1
6060
fi
61+
codespell:
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
65+
- name: Run codespell
66+
uses: codespell-project/actions-codespell@v2
67+
with:
68+
skip: '*.svg'

docs/examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This folder shows some examples how the NetBox Operator can be used.
44

5-
Each example folder contains a README.md which explains how you can set up your local enviroment to step through the examples.
5+
Each example folder contains a README.md which explains how you can set up your local environment to step through the examples.
66

77
Prerequisites:
88
- go version v1.24.0+

docs/examples/example2-load-balancer-ip/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ kubectl get pxc,ipaddresspool -A
5050
```bash
5151
cat sample-deployment.yaml
5252
```
53-
5. Apply the manifests to createa deployment with a service that gets a ip assigned from the metalLB pool created in the prevoius step
53+
5. Apply the manifests to create deployment with a service that gets a ip assigned from the metalLB pool created in the previous step
5454
```bash
5555
kubectl apply -f sample-deployment.yaml
5656
```

docs/examples/example5-multicluster/zurich-pools.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spec:
77
prefixLength: "/30"
88
parentPrefixSelector:
99
environment: prod
10-
familiy: IPv4
10+
family: IPv4
1111
---
1212
apiVersion: netbox.dev/v1
1313
kind: PrefixClaim

internal/controller/expected_netboxmock_calls_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func mockIpAddressListWithIpAddressFilterEmptyResult(ipamMock *mock_interfaces.M
5555
catchUnexpectedParams <- err
5656
return &ipam.IpamIPAddressesListOK{Payload: nil}, err
5757
}
58-
fmt.Printf("NETBOXMOCK\t ipam.IpamIPAddressesList (empty reslut) was called with expected input,\n")
58+
fmt.Printf("NETBOXMOCK\t ipam.IpamIPAddressesList (empty result) was called with expected input,\n")
5959
return &ipam.IpamIPAddressesListOK{Payload: mockedResponseEmptyIPAddressList()}, nil
6060
}).MinTimes(1)
6161
}
@@ -71,7 +71,7 @@ func mockIpAddressListWithHashFilterEmptyResult(ipamMock *mock_interfaces.MockIp
7171
catchUnexpectedParams <- err
7272
return &ipam.IpamIPAddressesListOK{Payload: nil}, err
7373
}
74-
fmt.Printf("NETBOXMOCK\t ipam.IpamIPAddressesList (empty reslut) was called with expected input,\n")
74+
fmt.Printf("NETBOXMOCK\t ipam.IpamIPAddressesList (empty result) was called with expected input,\n")
7575
return &ipam.IpamIPAddressesListOK{Payload: mockedResponseEmptyIPAddressList()}, nil
7676
}).MinTimes(1)
7777
}
@@ -87,7 +87,7 @@ func mockIpAddressListWithHashFilter(ipamMock *mock_interfaces.MockIpamInterface
8787
catchUnexpectedParams <- err
8888
return &ipam.IpamIPAddressesListOK{Payload: nil}, err
8989
}
90-
fmt.Printf("NETBOXMOCK\t ipam.IpamIPAddressesList (empty reslut) was called with expected input,\n")
90+
fmt.Printf("NETBOXMOCK\t ipam.IpamIPAddressesList (empty result) was called with expected input,\n")
9191
return &ipam.IpamIPAddressesListOK{Payload: mockedResponseIPAddressList()}, nil
9292
}).MinTimes(1)
9393
}
@@ -103,7 +103,7 @@ func mockIpAddressListWithHashFilterMismatch(ipamMock *mock_interfaces.MockIpamI
103103
catchUnexpectedParams <- err
104104
return &ipam.IpamIPAddressesListOK{Payload: nil}, err
105105
}
106-
fmt.Printf("NETBOXMOCK\t ipam.IpamIPAddressesList (empty reslut) was called with expected input,\n")
106+
fmt.Printf("NETBOXMOCK\t ipam.IpamIPAddressesList (empty result) was called with expected input,\n")
107107
return &ipam.IpamIPAddressesListOK{Payload: mockedResponseIPAddressListWithHash(customFieldsWithHashMismatch)}, nil
108108
}).MinTimes(1)
109109
}

internal/controller/prefixclaim_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (r *PrefixClaimReconciler) Reconcile(ctx context.Context, req ctrl.Request)
163163
return ctrl.Result{Requeue: true}, nil
164164
}
165165
if len(parentPrefixCandidates) == 0 {
166-
message := "no parent prefix found matching the parenPrefixSelector"
166+
message := "no parent prefix found matching the parentPrefixSelector"
167167
r.EventStatusRecorder.Recorder().Event(prefixClaim, corev1.EventTypeWarning, netboxv1.ConditionPrefixAssignedFalse.Reason, netboxv1.ConditionPrefixAssignedFalse.Message+": "+message)
168168
if err := r.EventStatusRecorder.Report(ctx, prefixClaim, netboxv1.ConditionPrefixAssignedFalse, corev1.EventTypeWarning, errors.New(message)); err != nil {
169169
return ctrl.Result{}, err

internal/controller/prefixclaim_helpers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func testPrefixClaimHash(t *testing.T, prefixClaim *netboxv1.PrefixClaim, expect
2626
generatedHash := generatePrefixRestorationHash(prefixClaim)
2727

2828
if generatedHash != expectedHash {
29-
t.Errorf("hash mistatch: expected %#v, got %#v from %#v", expectedHash, generatedHash, prefixClaim)
29+
t.Errorf("hash mismatch: expected %#v, got %#v from %#v", expectedHash, generatedHash, prefixClaim)
3030
}
3131
}
3232

pkg/netbox/api/ip_address_claim_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func TestIPAddressClaim_GetNoAvailableIPAddressWithTenancyChecks(t *testing.T) {
359359
mockTenancy := mock_interfaces.NewMockTenancyInterface(ctrl)
360360

361361
parentPrefix := "10.112.140.0/24"
362-
t.Run("No IP address asigned with an error when getting the tenant list", func(t *testing.T) {
362+
t.Run("No IP address assigned with an error when getting the tenant list", func(t *testing.T) {
363363

364364
tenantName := "Tenant1"
365365

@@ -388,7 +388,7 @@ func TestIPAddressClaim_GetNoAvailableIPAddressWithTenancyChecks(t *testing.T) {
388388
assert.Equal(t, actual, (*models.IPAddress)(nil))
389389
})
390390

391-
t.Run("No IP address asigned with non-existing tenant", func(t *testing.T) {
391+
t.Run("No IP address assigned with non-existing tenant", func(t *testing.T) {
392392

393393
// non existing tenant
394394
nonExistingTenant := "non-existing-tenant"

pkg/netbox/api/ip_address_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func TestIPAddress(t *testing.T) {
214214

215215
t.Run("Reserve Static IP Address.", func(t *testing.T) {
216216

217-
// ip address mock inout
217+
// ip address mock input
218218
input := ipam.NewIpamIPAddressesCreateParams().WithDefaults().WithData(writeableAddress())
219219
// ip address mock output
220220
output := &ipam.IpamIPAddressesCreateCreated{

pkg/netbox/api/ip_range_claim_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestIPRangeClaim(t *testing.T) {
4949
expectedIpDot5 := "10.112.140.5/32"
5050
expectedIpDot7 := "10.112.140.7/32"
5151

52-
// example of available IPv4 ip adress
52+
// example of available IPv4 ip address
5353
availableIpAdressesIPv4 := func() []*netboxModels.AvailableIP {
5454
return []*netboxModels.AvailableIP{
5555
{

0 commit comments

Comments
 (0)