diff --git a/.golangci.yml b/.golangci.yml index 3f33ddb60d1cb74ea7e3c33efcb3b0f45716db76..4c3844cf360e7242d74128a7d92020533856232e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -33,7 +33,8 @@ issues: linters: # enable the specific needed linters # see here for full list: https://golangci-lint.run/usage/linters/ - # linters to consider: gosimple, containedctx, contextcheck, depguard, errname, exhaustive, exhaustruct, forbidigo, forcetypeassert, forcetypeassert, gochecknoinits, gocognit, goconst + # linters to consider: gosimple, containedctx, contextcheck, depguard, errname, exhaustive, exhaustruct, forbidigo, forcetypeassert, + # forcetypeassert, gochecknoinits, gocognit, goconst, godot, gofumpt, gomnd, gosec, lll disable-all: true enable: - gofmt @@ -55,6 +56,10 @@ linters: - errchkjson - errorlint - exportloopref + - grouper + - importas + - makezero + - misspell # custom settings for linters linters-settings: diff --git a/cli/cmd/changeList.go b/cli/cmd/changeList.go index eb2c111e396cd9ba4e41b018425df56b654a99aa..ad780f4febec2c56ee39cacb3cce4c0338e1f89f 100644 --- a/cli/cmd/changeList.go +++ b/cli/cmd/changeList.go @@ -64,7 +64,7 @@ var changeListCmd = &cobra.Command{ data = append(data, []string{ch.String(), "pending"}) } for _, ch := range committed { - data = append(data, []string{ch.String(), "commited"}) + data = append(data, []string{ch.String(), "committed"}) } spinner.Success() diff --git a/cli/cmd/deviceDelete.go b/cli/cmd/deviceDelete.go index f5cc844e6ea5e81d641eb4399812b3dc635891a4..7cec3094a2bc5a1e139d83904a20a646f9e25594 100644 --- a/cli/cmd/deviceDelete.go +++ b/cli/cmd/deviceDelete.go @@ -69,7 +69,7 @@ The device UUID and request path must be specified as a positional arguments.`, if r.Status == ppb.Status_STATUS_OK { spinner.Success("A change for path deletion for Device: ", did.String(), "has been created -> Change ID: ", r.GetId()) } else { - spinner.Fail("An error occured while creating a path deletion request for Device with ID: ", r.GetId(), r.GetStatus()) + spinner.Fail("An error occurred while creating a path deletion request for Device with ID: ", r.GetId(), r.GetStatus()) } } return nil diff --git a/cli/completer/yangSchemaCompleter.go b/cli/completer/yangSchemaCompleter.go index 9eed2efa376bfc3a0c253186c42ed88d74dd6d92..2ebea1b2a0549d1a241e91daa6f1a6535bd2bac6 100644 --- a/cli/completer/yangSchemaCompleter.go +++ b/cli/completer/yangSchemaCompleter.go @@ -12,7 +12,7 @@ import ( ) var ( - // YangSchemaCompletionSeperator is the seperator for yang schemas + // YangSchemaCompletionSeperator is the separator for yang schemas YangSchemaCompletionSeperator = string([]byte{' ', '/'}) ) diff --git a/controller/northbound/server/test_util_test.go b/controller/northbound/server/test_util_test.go index 1456c90e0271e427922a6dad4ef52fd9ce708937..fea44b5cfb7239515eaa897930355aaa62e30019 100644 --- a/controller/northbound/server/test_util_test.go +++ b/controller/northbound/server/test_util_test.go @@ -161,7 +161,7 @@ func createTestRoles(roleService rbacInterfaces.RoleService) error { } // This is needed as a workaround for a bug where the output of the getUser test falsely was -// that it failed while actually passing. Apparantely, this can happen when loggers write +// that it failed while actually passing. Apparently, this can happen when loggers write // the output of test cases. // Solution found here: https://github.com/gotestyourself/gotestsum/issues/141#issuecomment-686243110 func patchLogger(t *testing.T) { diff --git a/controller/nucleus/change.go b/controller/nucleus/change.go index 935360ca57c77ff157f40168cff8c0c44dfc78da..4bd1c388aa8e8f6373af9be5f43df680333cfb68 100644 --- a/controller/nucleus/change.go +++ b/controller/nucleus/change.go @@ -81,7 +81,7 @@ func (c *Change) ID() uuid.UUID { // and starts the timeout-timer for the Change. If the timer expires // the change is rolled back. func (c *Change) Commit() error { - //TODO: check if already commited + //TODO: check if already committed c.stateIn <- ppb.ChangeState_CHANGE_STATE_COMMITTED select { case err := <-c.errChan: @@ -132,7 +132,7 @@ func stateManager(ctx context.Context, ch *Change, timeout time.Duration) (chan< stateIn := make(chan ppb.ChangeState) stateOut := make(chan ppb.ChangeState) // A Goroutine, which is created while a new Change is initialized acts as - // the reciever for errorChan + // the receiver for errorChan errChan := make(chan error) // create ticker and make it wait for 1 week // workaround for delayed ticker start and ugly housekeeping diff --git a/controller/nucleus/errors/errors.go b/controller/nucleus/errors/errors.go index 19f2b70553497a73ec5cc052571ab2cfd2a603b1..483f4af8f3ac56f4956628b4457288a7799c17d1 100644 --- a/controller/nucleus/errors/errors.go +++ b/controller/nucleus/errors/errors.go @@ -160,7 +160,7 @@ func (e ErrTypeNotSupported) Error() string { } // ErrCouldNotMarshall implements Error interface and is called if a -// database respone can not be parsed. +// database response can not be parsed. type ErrCouldNotMarshall struct { Identifier any Type any diff --git a/controller/nucleus/principalNetworkDomain.go b/controller/nucleus/principalNetworkDomain.go index fc369e836c8b2bb58713615b39722c25d87f8169..90cd017847e946b0462dd10274c6b61c59482075 100644 --- a/controller/nucleus/principalNetworkDomain.go +++ b/controller/nucleus/principalNetworkDomain.go @@ -302,7 +302,7 @@ func (pnd *pndImplementation) UpdateDevice(device device.Device, modelAsString s return err } -// Actual implementation, bind to struct if neccessary +// Actual implementation, bind to struct if necessary func destroy() error { return nil } diff --git a/controller/nucleus/util/path/traverse.go b/controller/nucleus/util/path/traverse.go index 403ffc5e441f86013e3eb35a7b6ab331e50b0fb9..2505fe9f4e9980720964e1f558954fa77ae5398a 100644 --- a/controller/nucleus/util/path/traverse.go +++ b/controller/nucleus/util/path/traverse.go @@ -68,7 +68,7 @@ func processEntry(e *yang.Entry) *Element { return leaf } -// Strings constructs a slice containg all possible root to leaf paths. +// Strings constructs a slice containing all possible root to leaf paths. // Calls stringBuilder internally func Strings(paths map[string]*Element) []string { ch := make(chan string) diff --git a/csbi/grpc.go b/csbi/grpc.go index 80b772cfd658adcec76ad54795d17b5760cf6a4f..77a7fa850d9f6b04f7a69541cb0760976d464621 100644 --- a/csbi/grpc.go +++ b/csbi/grpc.go @@ -67,7 +67,7 @@ func (s server) Get(ctx context.Context, req *pb.GetRequest) (*pb.GetResponse, e } // Create creates a new cSBI; this includes generating a deployment, building -// the container, generating gostructs from the devices capabilites. +// the container, generating gostructs from the devices capabilities. func (s server) Create(ctx context.Context, req *pb.CreateRequest) (*pb.CreateResponse, error) { labels := prometheus.Labels{"rpc": "create"} start := promStartHook(labels, grpcRequestsTotal)