cli

package
v0.18.15 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChkCmd = &cobra.Command{
	Use:     "chk",
	Aliases: []string{"check"},
	Short:   "Run checkers",
	Long:    `Check all code standards for coding conventions`,
	Run: func(cmd *cobra.Command, args []string) {

		err := Config.Chk()

		if err != nil {
			log.Fatal(err)
		}
	},
}

ChkCmd Run all code checking commands

Config is a reference to an all ready setup configuration that these commands will utilise

View Source
var FmtCmd = &cobra.Command{
	Use:   "fmt",
	Short: "Run formatters",
	Long:  `Run all formatters in the list`,
	Run: func(cmd *cobra.Command, args []string) {
		Config.LintType = "fmt"
		err := Config.Run()

		if err != nil {
			log.Fatal(err)
		}
	},
}

FmtCmd Format code command

View Source
var LntCmd = &cobra.Command{
	Use:     "lnt",
	Aliases: []string{"lint", "all"},
	Short:   "Run everything",
	Long:    `Runs both format and then check`,
	Run: func(cmd *cobra.Command, args []string) {
		Config.LintType = "fmt"
		err := Config.Run()

		if err != nil {
			log.Fatal(err)
		}

		err = Config.Chk()

		if err != nil {
			log.Fatal(err)
		}
	},
}

LntCmd Runs all commands

View Source
var LsCmd = &cobra.Command{
	Use:     "ls",
	Aliases: []string{"list"},
	Short:   "List languages",
	Long:    `List all languages available and the commands run when used`,
	Run: func(cmd *cobra.Command, args []string) {
		Config.List()
	},
}

LsCmd List support languages command

View Source
var NonCmd = &cobra.Command{
	Use:     "non",
	Aliases: []string{"not-linted"},
	Short:   "List what isn't supported for this project",
	Long: `Find the file extensions that dont
			have an associated regex match within crie`,
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("")
		Config.NoStandards()
	},
}

NonCmd List every type of file that just passes through

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