diff --git a/.golangci.yaml b/.golangci.yaml index aa455ae..5938667 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -3,9 +3,9 @@ run: tests: false output: sort-results: true - format: tab + format: html linters: - enable-all: false + disable-all: true enable: - deadcode - errcheck @@ -19,13 +19,3 @@ linters: - gofumpt - nosnakecase - goconst - presets: - - bugs - - comment - - complexity - - error - - metalinter - - module - - performance - - sql - - unused diff --git a/cmd/builder/builder_func.go b/cmd/builder/builder_func.go index 4d90743..7d268e3 100644 --- a/cmd/builder/builder_func.go +++ b/cmd/builder/builder_func.go @@ -28,9 +28,9 @@ const ( ) var builtinActions = []shared.CmdAction{ - {"build", buildCommand}, - {"clean", cleanCommand}, - {"test", testCommand}, + {A: "build", B: buildCommand}, + {A: "clean", B: cleanCommand}, + {A: "test", B: testCommand}, } func findMain(dir string) (string, error) { diff --git a/cmd/exec.go b/cmd/exec.go index da3b235..50876f6 100644 --- a/cmd/exec.go +++ b/cmd/exec.go @@ -41,17 +41,18 @@ func exec(execution internal.Execution, cmd *cobra.Command, args ...string) erro args = append(args, execution.Actions...) return validateCommitMsg(cmd, args...) } else { + var err error for _, action := range execution.Actions { for _, cmdAction := range builder.Actions() { if action == cmdAction.A { - if err := cmdAction.B(cmd, args...); err != nil { + if err = cmdAction.B(cmd, args...); err != nil { return err } } } } + return err } - return nil } // execCmd represents the exec command diff --git a/cmd/plugin.go b/cmd/plugin.go index 93070f1..024228d 100644 --- a/cmd/plugin.go +++ b/cmd/plugin.go @@ -41,7 +41,6 @@ var installPluginCmd = &cobra.Command{ func init() { // init pluginCmd builderCmd.AddCommand(pluginCmd) - pluginCmd.Flags().BoolVarP(&plugin.UpdateList, "update", "u", false, "update configured plugins") // init installPluginCmd pluginCmd.AddCommand(installPluginCmd) diff --git a/cmd/resources/.golangci.yaml b/cmd/resources/.golangci.yaml index aa455ae..61b4b2e 100755 --- a/cmd/resources/.golangci.yaml +++ b/cmd/resources/.golangci.yaml @@ -3,9 +3,9 @@ run: tests: false output: sort-results: true - format: tab + format: html linters: - enable-all: false + disable-all: true enable: - deadcode - errcheck @@ -14,18 +14,7 @@ linters: - ineffassign - staticcheck - unused - - varcheck - gosec - gofumpt - - nosnakecase - goconst - presets: - - bugs - - comment - - complexity - - error - - metalinter - - module - - performance - - sql - - unused + - revive diff --git a/cmd/shared/action.go b/cmd/shared/action.go index d1f60bf..468e14c 100644 --- a/cmd/shared/action.go +++ b/cmd/shared/action.go @@ -80,7 +80,7 @@ func execPlugin(cmd *cobra.Command, args ...string) error { exeCmd := exec.Command(plugin.B, lo.Map(cmds, func(cmd string, _ int) string { return strings.TrimSpace(cmd) })...) - return StreamExtCmdOutput(exeCmd, filepath.Join(internal.CurProject().Target(), fmt.Sprintf("%s.log", args[0])), "") + return StreamExtCmdOutput(exeCmd, filepath.Join(internal.CurProject().Target(), fmt.Sprintf("%s.html", args[0])), "") } func PluginActions() []CmdAction { diff --git a/internal/project.go b/internal/project.go index 6aea68d..81d64ff 100644 --- a/internal/project.go +++ b/internal/project.go @@ -185,7 +185,7 @@ func (project *Project) Plugins() []lo.Tuple4[string, string, string, string] { attr := value.(map[string]any) //@todo validate attribute for null or empty return lo.Tuple4[string, string, string, string]{ - key, attr["alias"].(string), attr["command"].(string), attr["url"].(string), + A: key, B: attr["alias"].(string), C: attr["command"].(string), D: attr["url"].(string), } }) } else { @@ -226,9 +226,9 @@ func (project *Project) PluginCommands() []lo.Tuple3[string, string, string] { cmd, _ := lo.Last(strings.Split(plugin.D, "/")) cmd = strings.ReplaceAll(cmd, "@", "-") return lo.Tuple3[string, string, string]{ - plugin.B, - cmd, - plugin.C, + A: plugin.B, + B: cmd, + C: plugin.C, } }) }