From 740c82cfa1002f9031a69da08e4202bd90019fa6 Mon Sep 17 00:00:00 2001 From: Michael Brooks Date: Fri, 23 Jan 2026 15:03:52 -0800 Subject: [PATCH] refactor: remove unused .slackignore support and dependencies --- cmd/root.go | 4 --- go.mod | 1 - go.sum | 2 -- internal/config/slackignore.go | 45 ---------------------------------- 4 files changed, 52 deletions(-) delete mode 100644 internal/config/slackignore.go diff --git a/cmd/root.go b/cmd/root.go index 0bcf5b3d..2bc65e55 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -42,7 +42,6 @@ import ( "github.com/slackapi/slack-cli/cmd/upgrade" versioncmd "github.com/slackapi/slack-cli/cmd/version" "github.com/slackapi/slack-cli/internal/cmdutil" - "github.com/slackapi/slack-cli/internal/config" "github.com/slackapi/slack-cli/internal/iostreams" "github.com/slackapi/slack-cli/internal/pkg/version" "github.com/slackapi/slack-cli/internal/shared" @@ -316,9 +315,6 @@ func InitConfig(ctx context.Context, clients *shared.ClientFactory, rootCmd *cob clients.Config.RuntimeVersion = clients.Runtime.Version() } - // Initialize .slackignore contents - config.InitSlackIgnore() - // Init debug log file with CLI Version, OS, SessionID, TraceID, SystemID, ProjectID, etc return clients.IO.InitLogFile(ctx) } diff --git a/go.mod b/go.mod index 8cba4741..66981362 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,6 @@ require ( github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c github.com/pkg/errors v0.9.1 github.com/radovskyb/watcher v1.0.7 - github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 github.com/spf13/afero v1.15.0 github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.11.1 diff --git a/go.sum b/go.sum index 32bcb30d..579cdd60 100644 --- a/go.sum +++ b/go.sum @@ -128,8 +128,6 @@ github.com/radovskyb/watcher v1.0.7/go.mod h1:78okwvY5wPdzcb1UYnip1pvrZNIVEIh/Cm github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI= -github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs= github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw= github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= diff --git a/internal/config/slackignore.go b/internal/config/slackignore.go deleted file mode 100644 index b5627ff3..00000000 --- a/internal/config/slackignore.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022-2025 Salesforce, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package config - -import ( - "os" - "path/filepath" - - gogitignore "github.com/sabhiram/go-gitignore" -) - -const SlackIgnoreFileName = ".slackignore" - -var SlackIgnore *gogitignore.GitIgnore - -// InitSlackIgnore: Initialize contents (file names, directories etc) of the .slackignore file. -// If an error occurs, it initializes as an empty .slackignore file -func InitSlackIgnore() { - var wd, err = os.Getwd() - if err != nil { - SlackIgnore = &gogitignore.GitIgnore{} - return - } - - var slackignore = filepath.Join(wd, SlackIgnoreFileName) - object, err := gogitignore.CompileIgnoreFile(slackignore) - if err != nil { - SlackIgnore = &gogitignore.GitIgnore{} - return - } - - SlackIgnore = object -}