Skip to content

Commit

Permalink
chore: tweak nolintlint settings
Browse files Browse the repository at this point in the history
Copy from kres manually for now.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
  • Loading branch information
AlekSi authored and talos-bot committed Mar 25, 2021
1 parent 1f5a0c4 commit fb605a0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ linters-settings:
nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
max-func-lines: 30
nolintlint:
allow-unused: false
allow-leading-space: false
allow-no-explanation: []
require-explanation: false
require-specific: true
prealloc:
# XXX: we don't recommend using this linter before doing performance profiling.
# For most programs usage of prealloc will be a premature optimization.
Expand Down
2 changes: 1 addition & 1 deletion cmd/talosctl/cmd/talos/convert-k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func init() {
convertK8sCmd.Flags().BoolVar(&convertOptions.OnlyRemoveInitializedKey, "remove-initialized-key", false, "only remove bootkube initialized key (used in manual conversion)")

// hiding this flag as it should only be used in manual process (and it's documented there), but should never be used in automatic conversion
convertK8sCmd.Flags().MarkHidden("remove-initialized-key") //nolint: errcheck
convertK8sCmd.Flags().MarkHidden("remove-initialized-key") //nolint:errcheck

addCommand(convertK8sCmd)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/app/networkd/pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (r *NetworkServer) Routes(ctx context.Context, in *empty.Empty) (reply *net
return nil, err
}

defer conn.Close() //nolint: errcheck
defer conn.Close() //nolint:errcheck

list, err := conn.Route.List()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cluster/kubernetes/talos_managed.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ func upgradeConfigPatcher(options UpgradeOptions, service string, configResource
config.ClusterConfig = &v1alpha1config.ClusterConfig{}
}

configData := configResource.(*resource.Any).Value().(map[string]interface{}) //nolint: errcheck,forcetypeassert
configImage := configData["image"].(string) //nolint: errcheck,forcetypeassert
configData := configResource.(*resource.Any).Value().(map[string]interface{}) //nolint:errcheck,forcetypeassert
configImage := configData["image"].(string) //nolint:errcheck,forcetypeassert

switch service {
case kubeAPIServer:
Expand Down

0 comments on commit fb605a0

Please sign in to comment.