mirror of https://github.com/databricks/cli.git
exclude cobra functions from errcheck
This commit is contained in:
parent
ee67bb37e3
commit
09a2a408b9
|
@ -16,5 +16,10 @@ linters-settings:
|
||||||
replacement: 'a[b:]'
|
replacement: 'a[b:]'
|
||||||
- pattern: 'interface{}'
|
- pattern: 'interface{}'
|
||||||
replacement: 'any'
|
replacement: 'any'
|
||||||
|
errcheck:
|
||||||
|
exclude-functions:
|
||||||
|
- (*github.com/spf13/pflag.FlagSet).MarkHidden
|
||||||
|
- (*github.com/spf13/pflag.FlagSet).MarkDeprecated
|
||||||
|
- (*github.com/spf13/cobra.Command).RegisterFlagCompletionFunc
|
||||||
issues:
|
issues:
|
||||||
exclude-dirs-use-default: false # recommended by docs https://golangci-lint.run/usage/false-positives/
|
exclude-dirs-use-default: false # recommended by docs https://golangci-lint.run/usage/false-positives/
|
||||||
|
|
|
@ -33,10 +33,10 @@ func newDeployCommand() *cobra.Command {
|
||||||
cmd.Flags().StringVar(&clusterId, "compute-id", "", "Override cluster in the deployment with the given compute ID.")
|
cmd.Flags().StringVar(&clusterId, "compute-id", "", "Override cluster in the deployment with the given compute ID.")
|
||||||
cmd.Flags().StringVarP(&clusterId, "cluster-id", "c", "", "Override cluster in the deployment with the given cluster ID.")
|
cmd.Flags().StringVarP(&clusterId, "cluster-id", "c", "", "Override cluster in the deployment with the given cluster ID.")
|
||||||
cmd.Flags().BoolVar(&autoApprove, "auto-approve", false, "Skip interactive approvals that might be required for deployment.")
|
cmd.Flags().BoolVar(&autoApprove, "auto-approve", false, "Skip interactive approvals that might be required for deployment.")
|
||||||
_ = cmd.Flags().MarkDeprecated("compute-id", "use --cluster-id instead")
|
cmd.Flags().MarkDeprecated("compute-id", "use --cluster-id instead")
|
||||||
cmd.Flags().BoolVar(&verbose, "verbose", false, "Enable verbose output.")
|
cmd.Flags().BoolVar(&verbose, "verbose", false, "Enable verbose output.")
|
||||||
// Verbose flag currently only affects file sync output, it's used by the vscode extension
|
// Verbose flag currently only affects file sync output, it's used by the vscode extension
|
||||||
_ = cmd.Flags().MarkHidden("verbose")
|
cmd.Flags().MarkHidden("verbose")
|
||||||
|
|
||||||
cmd.RunE = func(cmd *cobra.Command, args []string) error {
|
cmd.RunE = func(cmd *cobra.Command, args []string) error {
|
||||||
ctx := cmd.Context()
|
ctx := cmd.Context()
|
||||||
|
|
|
@ -460,7 +460,7 @@ func NewGenerateDashboardCommand() *cobra.Command {
|
||||||
cmd.MarkFlagsMutuallyExclusive("watch", "existing-id")
|
cmd.MarkFlagsMutuallyExclusive("watch", "existing-id")
|
||||||
|
|
||||||
// Completion for the resource flag.
|
// Completion for the resource flag.
|
||||||
_ = cmd.RegisterFlagCompletionFunc("resource", dashboardResourceCompletion)
|
cmd.RegisterFlagCompletionFunc("resource", dashboardResourceCompletion)
|
||||||
|
|
||||||
cmd.RunE = d.RunE
|
cmd.RunE = d.RunE
|
||||||
return cmd
|
return cmd
|
||||||
|
|
|
@ -37,7 +37,7 @@ func (e ErrNoAccountProfiles) Error() string {
|
||||||
|
|
||||||
func initProfileFlag(cmd *cobra.Command) {
|
func initProfileFlag(cmd *cobra.Command) {
|
||||||
cmd.PersistentFlags().StringP("profile", "p", "", "~/.databrickscfg profile")
|
cmd.PersistentFlags().StringP("profile", "p", "", "~/.databrickscfg profile")
|
||||||
_ = cmd.RegisterFlagCompletionFunc("profile", profile.ProfileCompletion)
|
cmd.RegisterFlagCompletionFunc("profile", profile.ProfileCompletion)
|
||||||
}
|
}
|
||||||
|
|
||||||
func profileFlagValue(cmd *cobra.Command) (string, bool) {
|
func profileFlagValue(cmd *cobra.Command) (string, bool) {
|
||||||
|
|
Loading…
Reference in New Issue