Skip to content

Commit 8eadf5c

Browse files
committed
exclude cobra functions from errcheck
1 parent 39c19d4 commit 8eadf5c

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

.golangci.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,10 @@ linters-settings:
1616
replacement: 'a[b:]'
1717
- pattern: 'interface{}'
1818
replacement: 'any'
19+
errcheck:
20+
exclude-functions:
21+
- (*github.com/spf13/pflag.FlagSet).MarkHidden
22+
- (*github.com/spf13/pflag.FlagSet).MarkDeprecated
23+
- (*github.com/spf13/cobra.Command).RegisterFlagCompletionFunc
1924
issues:
2025
exclude-dirs-use-default: false # recommended by docs https://golangci-lint.run/usage/false-positives/

cmd/bundle/deploy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ func newDeployCommand() *cobra.Command {
3333
cmd.Flags().StringVar(&clusterId, "compute-id", "", "Override cluster in the deployment with the given compute ID.")
3434
cmd.Flags().StringVarP(&clusterId, "cluster-id", "c", "", "Override cluster in the deployment with the given cluster ID.")
3535
cmd.Flags().BoolVar(&autoApprove, "auto-approve", false, "Skip interactive approvals that might be required for deployment.")
36-
_ = cmd.Flags().MarkDeprecated("compute-id", "use --cluster-id instead")
36+
cmd.Flags().MarkDeprecated("compute-id", "use --cluster-id instead")
3737
cmd.Flags().BoolVar(&verbose, "verbose", false, "Enable verbose output.")
3838
// Verbose flag currently only affects file sync output, it's used by the vscode extension
39-
_ = cmd.Flags().MarkHidden("verbose")
39+
cmd.Flags().MarkHidden("verbose")
4040

4141
cmd.RunE = func(cmd *cobra.Command, args []string) error {
4242
ctx := cmd.Context()

cmd/bundle/generate/dashboard.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ func NewGenerateDashboardCommand() *cobra.Command {
460460
cmd.MarkFlagsMutuallyExclusive("watch", "existing-id")
461461

462462
// Completion for the resource flag.
463-
_ = cmd.RegisterFlagCompletionFunc("resource", dashboardResourceCompletion)
463+
cmd.RegisterFlagCompletionFunc("resource", dashboardResourceCompletion)
464464

465465
cmd.RunE = d.RunE
466466
return cmd

cmd/root/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (e ErrNoAccountProfiles) Error() string {
3737

3838
func initProfileFlag(cmd *cobra.Command) {
3939
cmd.PersistentFlags().StringP("profile", "p", "", "~/.databrickscfg profile")
40-
_ = cmd.RegisterFlagCompletionFunc("profile", profile.ProfileCompletion)
40+
cmd.RegisterFlagCompletionFunc("profile", profile.ProfileCompletion)
4141
}
4242

4343
func profileFlagValue(cmd *cobra.Command) (string, bool) {

0 commit comments

Comments
 (0)