diff --git a/.golangci.yaml b/.golangci.yaml index 80e54ac1c..9db0bea77 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -160,9 +160,9 @@ issues: formatters: enable: + - gci - goimports # TODO: Disabled, because they are failing at the moment, we should fix them and enable (step by step) - # - gci # - gofmt # - gofumpt # - golines diff --git a/cmd/picoclaw/cmd_agent.go b/cmd/picoclaw/cmd_agent.go index cee9f68ec..254ec0087 100644 --- a/cmd/picoclaw/cmd_agent.go +++ b/cmd/picoclaw/cmd_agent.go @@ -13,6 +13,7 @@ import ( "strings" "github.com/chzyer/readline" + "github.com/sipeed/picoclaw/pkg/agent" "github.com/sipeed/picoclaw/pkg/bus" "github.com/sipeed/picoclaw/pkg/logger" diff --git a/pkg/channels/dingtalk.go b/pkg/channels/dingtalk.go index 79cc85219..c625203a7 100644 --- a/pkg/channels/dingtalk.go +++ b/pkg/channels/dingtalk.go @@ -10,6 +10,7 @@ import ( "github.com/open-dingtalk/dingtalk-stream-sdk-go/chatbot" "github.com/open-dingtalk/dingtalk-stream-sdk-go/client" + "github.com/sipeed/picoclaw/pkg/bus" "github.com/sipeed/picoclaw/pkg/config" "github.com/sipeed/picoclaw/pkg/logger" diff --git a/pkg/channels/discord.go b/pkg/channels/discord.go index 342ddb478..c4d29c7f2 100644 --- a/pkg/channels/discord.go +++ b/pkg/channels/discord.go @@ -9,6 +9,7 @@ import ( "time" "github.com/bwmarrin/discordgo" + "github.com/sipeed/picoclaw/pkg/bus" "github.com/sipeed/picoclaw/pkg/config" "github.com/sipeed/picoclaw/pkg/logger" diff --git a/pkg/channels/telegram.go b/pkg/channels/telegram.go index 20bbf6830..b0a619ec8 100644 --- a/pkg/channels/telegram.go +++ b/pkg/channels/telegram.go @@ -11,10 +11,8 @@ import ( "sync" "time" - th "github.com/mymmrac/telego/telegohandler" - "github.com/mymmrac/telego" - "github.com/mymmrac/telego/telegohandler" + th "github.com/mymmrac/telego/telegohandler" tu "github.com/mymmrac/telego/telegoutil" "github.com/sipeed/picoclaw/pkg/bus" @@ -101,7 +99,7 @@ func (c *TelegramChannel) Start(ctx context.Context) error { return fmt.Errorf("failed to start long polling: %w", err) } - bh, err := telegohandler.NewBotHandler(c.bot, updates) + bh, err := th.NewBotHandler(c.bot, updates) if err != nil { return fmt.Errorf("failed to create bot handler: %w", err) } diff --git a/pkg/channels/telegram_commands.go b/pkg/channels/telegram_commands.go index df245e156..803c3c9cd 100644 --- a/pkg/channels/telegram_commands.go +++ b/pkg/channels/telegram_commands.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/mymmrac/telego" + "github.com/sipeed/picoclaw/pkg/config" ) diff --git a/pkg/providers/anthropic/provider.go b/pkg/providers/anthropic/provider.go index a27a25a2d..5a159d32f 100644 --- a/pkg/providers/anthropic/provider.go +++ b/pkg/providers/anthropic/provider.go @@ -9,6 +9,7 @@ import ( "github.com/anthropics/anthropic-sdk-go" "github.com/anthropics/anthropic-sdk-go/option" + "github.com/sipeed/picoclaw/pkg/providers/protocoltypes" ) diff --git a/pkg/providers/claude_provider_test.go b/pkg/providers/claude_provider_test.go index b1bcd8b40..59d92a1a9 100644 --- a/pkg/providers/claude_provider_test.go +++ b/pkg/providers/claude_provider_test.go @@ -8,6 +8,7 @@ import ( "github.com/anthropics/anthropic-sdk-go" anthropicoption "github.com/anthropics/anthropic-sdk-go/option" + anthropicprovider "github.com/sipeed/picoclaw/pkg/providers/anthropic" ) diff --git a/pkg/providers/codex_provider.go b/pkg/providers/codex_provider.go index e3526cfb5..1d3222a36 100644 --- a/pkg/providers/codex_provider.go +++ b/pkg/providers/codex_provider.go @@ -10,6 +10,7 @@ import ( "github.com/openai/openai-go/v3" "github.com/openai/openai-go/v3/option" "github.com/openai/openai-go/v3/responses" + "github.com/sipeed/picoclaw/pkg/auth" "github.com/sipeed/picoclaw/pkg/logger" ) diff --git a/pkg/providers/github_copilot_provider.go b/pkg/providers/github_copilot_provider.go index 5058819f5..2cee446e6 100644 --- a/pkg/providers/github_copilot_provider.go +++ b/pkg/providers/github_copilot_provider.go @@ -2,10 +2,9 @@ package providers import ( "context" + "encoding/json" "fmt" - json "encoding/json" - copilot "github.com/github/copilot-sdk/go" ) diff --git a/pkg/skills/clawhub_registry_test.go b/pkg/skills/clawhub_registry_test.go index d12e19504..d477c9155 100644 --- a/pkg/skills/clawhub_registry_test.go +++ b/pkg/skills/clawhub_registry_test.go @@ -11,9 +11,10 @@ import ( "path/filepath" "testing" - "github.com/sipeed/picoclaw/pkg/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/sipeed/picoclaw/pkg/utils" ) func newTestRegistry(serverURL, authToken string) *ClawHubRegistry { diff --git a/pkg/skills/registry_test.go b/pkg/skills/registry_test.go index daecd5a59..a4694bd43 100644 --- a/pkg/skills/registry_test.go +++ b/pkg/skills/registry_test.go @@ -6,8 +6,9 @@ import ( "testing" "time" - "github.com/sipeed/picoclaw/pkg/utils" "github.com/stretchr/testify/assert" + + "github.com/sipeed/picoclaw/pkg/utils" ) // mockRegistry is a test double implementing SkillRegistry. diff --git a/pkg/tools/skills_install_test.go b/pkg/tools/skills_install_test.go index e6941a950..aa3bc95a4 100644 --- a/pkg/tools/skills_install_test.go +++ b/pkg/tools/skills_install_test.go @@ -6,9 +6,10 @@ import ( "path/filepath" "testing" - "github.com/sipeed/picoclaw/pkg/skills" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/sipeed/picoclaw/pkg/skills" ) func TestInstallSkillToolName(t *testing.T) { diff --git a/pkg/tools/skills_search_test.go b/pkg/tools/skills_search_test.go index 7e07b2775..2419d5147 100644 --- a/pkg/tools/skills_search_test.go +++ b/pkg/tools/skills_search_test.go @@ -4,8 +4,9 @@ import ( "context" "testing" - "github.com/sipeed/picoclaw/pkg/skills" "github.com/stretchr/testify/assert" + + "github.com/sipeed/picoclaw/pkg/skills" ) func TestFindSkillsToolName(t *testing.T) { diff --git a/pkg/utils/media.go b/pkg/utils/media.go index 2b184f2ec..7c32a6ae8 100644 --- a/pkg/utils/media.go +++ b/pkg/utils/media.go @@ -9,6 +9,7 @@ import ( "time" "github.com/google/uuid" + "github.com/sipeed/picoclaw/pkg/logger" )