From 8fb9c6d813d985030283b3d9ff7f04f3630492c2 Mon Sep 17 00:00:00 2001 From: Keith Patrick Date: Thu, 5 Mar 2026 05:27:03 +0000 Subject: [PATCH] fix: linter issues - octal literals and alignment --- cmd/picoclaw/internal/plugins/command.go | 8 ++++---- cmd/picoclaw/internal/plugins/command_test.go | 2 +- cmd/picoclaw/main.go | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/picoclaw/internal/plugins/command.go b/cmd/picoclaw/internal/plugins/command.go index f8fcd6d3a..34a32e360 100644 --- a/cmd/picoclaw/internal/plugins/command.go +++ b/cmd/picoclaw/internal/plugins/command.go @@ -102,7 +102,7 @@ func listPlugins() ([]string, error) { } // Check if executable by anyone - if info.Mode()&0111 != 0 { + if info.Mode()&0o111 != 0 { plugins = append(plugins, entry.Name()) } } @@ -120,7 +120,7 @@ func findPlugin(name string) (string, error) { // Try exact match first pluginPath := filepath.Join(pluginsDir, name) - if info, err := os.Stat(pluginPath); err == nil && !info.IsDir() && info.Mode()&0111 != 0 { + if info, err := os.Stat(pluginPath); err == nil && !info.IsDir() && info.Mode()&0o111 != 0 { return pluginPath, nil } @@ -128,7 +128,7 @@ func findPlugin(name string) (string, error) { extensions := []string{".sh", ".bash", ".py", ".go", ""} for _, ext := range extensions { extPath := pluginPath + ext - if info, err := os.Stat(extPath); err == nil && !info.IsDir() && info.Mode()&0111 != 0 { + if info, err := os.Stat(extPath); err == nil && !info.IsDir() && info.Mode()&0o111 != 0 { return extPath, nil } } @@ -145,7 +145,7 @@ func findPlugin(name string) (string, error) { if err != nil { continue } - if info.Mode()&0111 == 0 { + if info.Mode()&0o111 == 0 { continue } pluginName := entry.Name() diff --git a/cmd/picoclaw/internal/plugins/command_test.go b/cmd/picoclaw/internal/plugins/command_test.go index 78885250a..fbb9da12a 100644 --- a/cmd/picoclaw/internal/plugins/command_test.go +++ b/cmd/picoclaw/internal/plugins/command_test.go @@ -75,7 +75,7 @@ func TestRunPluginNotFound(t *testing.T) { func TestListPluginsIntegration(t *testing.T) { // This is an integration test that checks the actual plugins directory pluginsDir := getPluginsDir() - + // Create a temporary test plugin tmpDir := pluginsDir if err := os.MkdirAll(tmpDir, 0755); err != nil { diff --git a/cmd/picoclaw/main.go b/cmd/picoclaw/main.go index ea2d12567..9a8e8e260 100644 --- a/cmd/picoclaw/main.go +++ b/cmd/picoclaw/main.go @@ -29,11 +29,11 @@ func NewPicoclawCommand() *cobra.Command { short := fmt.Sprintf("%s picoclaw - Personal AI Assistant v%s\n\n", internal.Logo, internal.GetVersion()) cmd := &cobra.Command{ - Use: "picoclaw", - Short: short, - Example: "picoclaw list", - Args: rootArgsValidator, - ValidArgsFunction: rootCompleteArgs, + Use: "picoclaw", + Short: short, + Example: "picoclaw list", + Args: rootArgsValidator, + ValidArgsFunction: rootCompleteArgs, DisableFlagParsing: true, // Pass all args (including flags) directly to plugins/commands RunE: func(cmd *cobra.Command, args []string) error { // With DisableFlagParsing, --help is just an arg - show help