chore(lint): remove init check

This commit is contained in:
Jan De Dobbeleer 2024-05-04 08:02:16 +02:00 committed by Jan De Dobbeleer
parent 1c8347287a
commit e5156a8d44
20 changed files with 19 additions and 20 deletions

View file

@ -8,7 +8,6 @@ linters:
- dupl
- errcheck
- exhaustive
- gochecknoinits
- goconst
- gocritic
- gocyclo

View file

@ -9,7 +9,7 @@ import (
"github.com/mattn/go-runewidth"
)
func init() { //nolint:gochecknoinits
func init() {
runewidth.DefaultCondition.EastAsianWidth = false
}

View file

@ -57,7 +57,7 @@ You can do the following:
},
}
func init() { //nolint:gochecknoinits
func init() {
RootCmd.AddCommand(getCache)
}

View file

@ -39,6 +39,6 @@ You can export, migrate or edit the config.`,
},
}
func init() { //nolint:gochecknoinits
func init() {
RootCmd.AddCommand(configCmd)
}

View file

@ -96,7 +96,7 @@ func cleanOutputPath(path string, env platform.Environment) string {
return filepath.Clean(path)
}
func init() { //nolint:gochecknoinits
func init() {
exportCmd.Flags().StringVarP(&format, "format", "f", "json", "config format to migrate to")
exportCmd.Flags().StringVarP(&output, "output", "o", "", "config file to export to")
configCmd.AddCommand(exportCmd)

View file

@ -106,7 +106,7 @@ Exports the config to an image file using customized output options.`,
},
}
func init() { //nolint:gochecknoinits
func init() {
imageCmd.Flags().StringVar(&author, "author", "", "config author")
imageCmd.Flags().StringVar(&bgColor, "background-color", "", "image background color")
imageCmd.Flags().StringVarP(&outputImage, "output", "o", "", "image file (.png) to export to")

View file

@ -57,7 +57,7 @@ A backup of the current config can be found at ~/myconfig.omp.json.bak.`,
},
}
func init() { //nolint:gochecknoinits
func init() {
migrateCmd.Flags().BoolVarP(&write, "write", "w", false, "write the migrated config back to the config file")
migrateCmd.Flags().StringVarP(&format, "format", "f", "json", "the config format to migrate to")
configCmd.AddCommand(migrateCmd)

View file

@ -59,7 +59,7 @@ A backup of the current config can be found at ~/myconfig.omp.json.bak.`,
},
}
func init() { //nolint:gochecknoinits
func init() {
migrateGlyphsCmd.Flags().BoolVarP(&write, "write", "w", false, "write the migrated config back to the config file")
migrateGlyphsCmd.Flags().StringVarP(&format, "format", "f", "", "the config format to migrate to")
migrateCmd.AddCommand(migrateGlyphsCmd)

View file

@ -60,7 +60,7 @@ var debugCmd = &cobra.Command{
},
}
func init() { //nolint:gochecknoinits
func init() {
debugCmd.Flags().StringVar(&pwd, "pwd", "", "current working directory")
debugCmd.Flags().StringVar(&shellName, "shell", "", "the shell to print for")
debugCmd.Flags().BoolVarP(&plain, "plain", "p", false, "plain text output (no ANSI)")

View file

@ -22,6 +22,6 @@ var disableCmd = &cobra.Command{
},
}
func init() { //nolint:gochecknoinits
func init() {
RootCmd.AddCommand(disableCmd)
}

View file

@ -37,7 +37,7 @@ var enableCmd = &cobra.Command{
},
}
func init() { //nolint:gochecknoinits
func init() {
RootCmd.AddCommand(enableCmd)
}

View file

@ -65,7 +65,7 @@ This command is used to install fonts and configure the font in your terminal.
}
)
func init() { //nolint:gochecknoinits
func init() {
RootCmd.AddCommand(fontCmd)
fontCmd.Flags().BoolVar(&user, "user", false, "install font as user")
}

View file

@ -91,7 +91,7 @@ This command is used to get the value of the following variables:
},
}
func init() { //nolint:gochecknoinits
func init() {
RootCmd.AddCommand(getCmd)
getCmd.Flags().StringVar(&shellName, "shell", "", "the shell to print for")
}

View file

@ -44,7 +44,7 @@ See the documentation to initialize your shell: https://ohmyposh.dev/docs/instal
}
)
func init() { //nolint:gochecknoinits
func init() {
initCmd.Flags().BoolVarP(&printOutput, "print", "p", false, "print the init script")
initCmd.Flags().BoolVarP(&strict, "strict", "s", false, "run in strict mode")
initCmd.Flags().BoolVarP(&manual, "manual", "m", false, "enable/disable manual mode")

View file

@ -27,6 +27,6 @@ var noticeCmd = &cobra.Command{
},
}
func init() { //nolint:gochecknoinits
func init() {
RootCmd.AddCommand(noticeCmd)
}

View file

@ -94,7 +94,7 @@ var printCmd = &cobra.Command{
},
}
func init() { //nolint:gochecknoinits
func init() {
printCmd.Flags().StringVar(&pwd, "pwd", "", "current working directory")
printCmd.Flags().StringVar(&pswd, "pswd", "", "current working directory (according to pwsh)")
printCmd.Flags().StringVar(&shellName, "shell", "", "the shell to print for")

View file

@ -15,7 +15,7 @@ var promptCmd = &cobra.Command{
},
}
func init() { //nolint:gochecknoinits
func init() {
// legacy support
promptCmd.AddCommand(initCmd)
promptCmd.AddCommand(debugCmd)

View file

@ -47,7 +47,7 @@ var (
initialize bool
)
func init() { //nolint:gochecknoinits
func init() {
RootCmd.PersistentFlags().StringVarP(&config, "config", "c", "", "config file path")
RootCmd.Flags().BoolVarP(&initialize, "init", "i", false, "init (deprecated)")
RootCmd.Flags().BoolVar(&displayVersion, "version", false, "version")

View file

@ -49,6 +49,6 @@ var toggleCmd = &cobra.Command{
},
}
func init() { //nolint:gochecknoinits
func init() {
RootCmd.AddCommand(toggleCmd)
}

View file

@ -27,7 +27,7 @@ var versionCmd = &cobra.Command{
},
}
func init() { //nolint:gochecknoinits
func init() {
versionCmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "write verbose output")
RootCmd.AddCommand(versionCmd)
}