run

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RunCheckCmd = &cobra.Command{
		Use:  "run",
		Long: `Runs the SQL static linting checks against migrations directory`,
		RunE: func(cmd *cobra.Command, args []string) error {
			if viper.ConfigFileUsed() != "" {

				configFlags := runCheckFlags{}
				if err := viper.Unmarshal(&configFlags); err != nil {
					return fmt.Errorf(
						"Failure to unmarshal config file via viper: %w",
						err,
					)
				}

				if configFlags.Dsn != "" {
					flags.Dsn = configFlags.Dsn
				}
				if configFlags.OutputDir != "" {
					flags.OutputDir = configFlags.OutputDir
				}
				if len(configFlags.Analyzers) != 0 {
					flags.Analyzers = configFlags.Analyzers
				}
				if len(configFlags.Config) != 0 {
					flags.Config = configFlags.Config

				}
				if configFlags.MigrationsDir != "" {
					flags.MigrationsDir = configFlags.MigrationsDir
				}
			}
			return runCheckRun(cmd, args, flags)
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL