Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
default: "dev-build"
docker: # run the steps with Docker
# CircleCI Go images available at: https://hub.docker.com/r/circleci/golang/
- image: cimg/go:1.25.7
- image: cimg/go:1.26.0
steps: # steps that comprise the `build` job
- checkout # check out source code to working directory
- restore_cache: # restores saved cache if no changes are detected since last run
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: "1.25.7"
go-version: "1.26.0"
- name: Lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: "1.25.7"
go-version: "1.26.0"
- name: Report health score
uses: slackapi/slack-health-score@d58a419f15cdaff97e9aa7f09f95772830ab66f7 # v0.1.1
with:
Expand Down
2 changes: 1 addition & 1 deletion cmd/app/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func RunAddCommand(ctx context.Context, clients *shared.ClientFactory, selection
}
clients.Config.Flags.Lookup("environment").Changed = true

clients.IO.PrintInfo(ctx, false, "\n"+style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{
Emoji: "warning",
Text: "Warning: Default App Environment",
Secondary: []string{
Expand Down
6 changes: 2 additions & 4 deletions cmd/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
package app

import (
"fmt"

"github.com/slackapi/slack-cli/internal/cmdutil"
"github.com/slackapi/slack-cli/internal/shared"
"github.com/slackapi/slack-cli/internal/style"
Expand Down Expand Up @@ -51,13 +49,13 @@ func NewCommand(clients *shared.ClientFactory) *cobra.Command {
ctx := cmd.Context()
// DEPRECATED(semver:major): remove the "workspace" alias
if cmd.CalledAs() == "workspace" {
clients.IO.PrintInfo(ctx, false, fmt.Sprintf(
clients.IO.PrintInfo(ctx, false,
"\n%s It looks like you used %s. This command will be deprecated in an upcoming release.\n You can now use %s instead of %s.\n ",
style.Emoji("bulb"),
style.Commandf("workspace", true),
style.Commandf("app", true),
style.Commandf("workspace", true),
))
)
}
return nil
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/app/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func LinkExistingApp(ctx context.Context, clients *shared.ClientFactory, app *ty
fmt.Sprintf(`manifest.source: "%s"`, config.ManifestSourceRemote),
).
WithRootCause(err)
clients.IO.PrintError(ctx, slackErr.Error())
clients.IO.PrintError(ctx, "%s", slackErr.Error())
}
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/auth/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ func printAuthSuccess(cmd *cobra.Command, IO iostreams.IOStreamer, credentialsPa
func printAuthNextSteps(ctx context.Context, clients *shared.ClientFactory) {
project, _ := clients.SDKConfig.Exists()
if !project {
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I remember in a previous life we had this syntax and had to remove it due to the linter. Now it's back 😆

Emoji: "bulb",
Text: fmt.Sprintf("Get started by creating a new app with %s", style.Commandf("create my-app", true)),
Secondary: []string{
fmt.Sprintf("Explore the details of available commands with %s", style.Commandf("help", false)),
},
}))
} else {
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "bulb",
Text: fmt.Sprintf("Review existing installations of the app with %s", style.Commandf("app list", false)),
Secondary: []string{
Expand Down
4 changes: 2 additions & 2 deletions cmd/auth/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ func printLogoutSuccess(ctx context.Context, clients *shared.ClientFactory, auth
}

clients.IO.PrintTrace(ctx, slacktrace.AuthLogoutSuccess)
clients.IO.PrintInfo(ctx, false, fmt.Sprintf("\n%s", style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{
Emoji: "wastebasket",
Text: revokedAuthText,
Secondary: logoutNextSteps,
})))
}))
}

// FormatAuthLabel returns a formatted auth label for user selection during logout
Expand Down
4 changes: 2 additions & 2 deletions cmd/auth/revoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ func printRevokeSuccess(ctx context.Context, clients *shared.ClientFactory) {
}

clients.IO.PrintTrace(ctx, slacktrace.AuthRevokeSuccess)
clients.IO.PrintInfo(ctx, false, fmt.Sprintf("\n%s", style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{
Emoji: "wastebasket",
Text: revokedAuthText,
Secondary: logoutNextSteps,
})))
}))
}
4 changes: 2 additions & 2 deletions cmd/datastore/count.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func printCountResult(ctx context.Context, clients *shared.ClientFactory, countR
clients.IO.PrintTrace(ctx, slacktrace.DatastoreCountSuccess)
clients.IO.PrintTrace(ctx, slacktrace.DatastoreCountTotal, fmt.Sprintf("%d", countResult.Count))
clients.IO.PrintTrace(ctx, slacktrace.DatastoreCountDatastore, countResult.Datastore)
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "tada",
Text: fmt.Sprintf(
"Counted %d matching items from datastore: %s",
Expand Down Expand Up @@ -203,7 +203,7 @@ func promptDatastoreCountRequest(

// Display a hint for writing expressions
clients.IO.PrintInfo(ctx, false, "")
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "bulb",
Text: "Expressions should use the following format",
Secondary: []string{
Expand Down
4 changes: 2 additions & 2 deletions cmd/datastore/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ func printDatastoreExpressionMarshal(ctx context.Context, clients *shared.Client
return err
}
clients.IO.PrintInfo(ctx, false, "")
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "open_file_folder",
Text: "This expression can be represented by the following JSON:",
}))
clients.IO.PrintInfo(ctx, false, style.Secondary(expression))
clients.IO.PrintInfo(ctx, false, "%s", style.Secondary(expression))
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/datastore/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func promptDatastoreQueryRequest(

// Display a hint for writing expressions
clients.IO.PrintInfo(ctx, false, "")
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "bulb",
Text: "Expressions should use the following format",
Secondary: []string{
Expand Down
2 changes: 1 addition & 1 deletion cmd/env/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func runEnvAddCommandFunc(clients *shared.ClientFactory, cmd *cobra.Command, arg
// Display the variable name before getting the variable value
if len(args) < 2 && !clients.Config.Flags.Lookup("value").Changed {
mimickedInput := iostreams.MimicInputPrompt("Variable name", variableName)
clients.IO.PrintInfo(ctx, false, mimickedInput)
clients.IO.PrintInfo(ctx, false, "%s", mimickedInput)
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/env/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func runEnvListCommandFunc(
)
}
clients.IO.PrintTrace(ctx, slacktrace.EnvListVariables, variableNames...)
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "evergreen_tree",
Text: "App Environment",
Secondary: variableLabel,
Expand Down
2 changes: 1 addition & 1 deletion cmd/externalauth/add_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func runAddClientSecretCommand(clients *shared.ClientFactory, cmd *cobra.Command
return err
}

clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "sparkles",
Text: fmt.Sprintf(
"Successfully added external auth client secret for %s",
Expand Down
4 changes: 2 additions & 2 deletions cmd/externalauth/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func runRemoveCommand(clients *shared.ClientFactory, cmd *cobra.Command) error {
return err
}

clients.IO.PrintInfo(ctx, false, style.Highlight("\nNote that this command will not revoke existing tokens, only remove them from Slack systems. You might be able to revoke them from a provider's dev console or APIs\n"))
clients.IO.PrintInfo(ctx, false, "%s", style.Highlight("\nNote that this command will not revoke existing tokens, only remove them from Slack systems. You might be able to revoke them from a provider's dev console or APIs\n"))

confirmMessage := "Are you sure you want to remove all tokens for this app relevant to the specified provider from your current team/org?"
if allProvidersFlag {
Expand Down Expand Up @@ -231,6 +231,6 @@ func runRemoveCommand(clients *shared.ClientFactory, cmd *cobra.Command) error {
)
}

clients.IO.PrintInfo(ctx, false, text)
clients.IO.PrintInfo(ctx, false, "%s", text)
return nil
}
24 changes: 11 additions & 13 deletions cmd/feedback/feedback.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,13 @@ var SurveyStore = map[string]SlackSurvey{
RawPath: "https://github.com/slackapi/slack-cli/issues",
},
Info: func(ctx context.Context, clients *shared.ClientFactory) {
clients.IO.PrintInfo(ctx, false, fmt.Sprintf(
"%s\n%s\n",
clients.IO.PrintInfo(ctx, false, "%s\n%s\n",
style.Secondary("Ask questions, submit issues, or suggest features for the Slack CLI:"),
style.Secondary(style.Highlight("https://github.com/slackapi/slack-cli/issues")),
))
)
},
Ask: func(ctx context.Context, clients *shared.ClientFactory) (bool, error) {
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "love_letter",
Text: "We would love to know how things are going",
Secondary: []string{
Expand All @@ -119,14 +118,13 @@ var SurveyStore = map[string]SlackSurvey{
PromptDescription: "Developer support for the Slack Platform, Slack API, Block Kit, and more",
URL: url.URL{RawPath: "https://docs.slack.dev/developer-support"},
Info: func(ctx context.Context, clients *shared.ClientFactory) {
clients.IO.PrintInfo(ctx, false, fmt.Sprintf(
"%s\n%s\n",
clients.IO.PrintInfo(ctx, false, "%s\n%s\n",
style.Secondary("You can send us a message at "+style.Highlight(email)),
style.Secondary("Or, share your experiences at "+style.Highlight("https://docs.slack.dev/developer-support")),
))
)
},
Ask: func(ctx context.Context, clients *shared.ClientFactory) (bool, error) {
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "love_letter",
Text: "We would love to know how things are going",
Secondary: []string{
Expand Down Expand Up @@ -260,7 +258,7 @@ func runFeedbackCommand(ctx context.Context, clients *shared.ClientFactory, cmd
return slackerror.New(slackerror.ErrFeedbackNameRequired)
}

clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "love_letter",
Text: leadMessage,
}))
Expand Down Expand Up @@ -304,7 +302,7 @@ func initSurveyOpts(ctx context.Context, clients *shared.ClientFactory, surveys
var opts []string
for _, s := range sortedSurveys {
if s.Config == nil {
clients.IO.PrintDebug(ctx, fmt.Sprintf("survey config not set; skipping %s", s.Name))
clients.IO.PrintDebug(ctx, "survey config not set; skipping %s", s.Name)
continue
}
names = append(names, s.Name)
Expand All @@ -322,7 +320,7 @@ func initSurveyOpts(ctx context.Context, clients *shared.ClientFactory, surveys
}
t, err := time.Parse(time.RFC3339, cfg.CompletedAt)
if err != nil {
clients.IO.PrintDebug(ctx, err.Error())
clients.IO.PrintDebug(ctx, "%s", err.Error())
opts = append(opts, s.PromptDisplayText)
continue
}
Expand Down Expand Up @@ -362,7 +360,7 @@ func executeSurvey(ctx context.Context, clients *shared.ClientFactory, s SlackSu
if ok { // Open survey in browser
clients.Browser().OpenURL(url)
} else { // Print survey URL
clients.IO.PrintInfo(ctx, false, fmt.Sprint("Feedback URL: \n", style.Secondary(url)))
clients.IO.PrintInfo(ctx, false, "Feedback URL: \n%s", style.Secondary(url))
}

// Record completion
Expand Down Expand Up @@ -465,6 +463,6 @@ func ShowSurveyMessages(ctx context.Context, clients *shared.ClientFactory) erro
func ShowFeedbackMessageOnTerminate(ctx context.Context, clients *shared.ClientFactory) {
err := ShowSurveyMessages(ctx, clients)
if err != nil {
clients.IO.PrintError(ctx, err.Error())
clients.IO.PrintError(ctx, "%s", err.Error())
}
}
10 changes: 4 additions & 6 deletions cmd/function/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,22 +281,20 @@ func distributePermissionFile(ctx context.Context, clients *shared.ClientFactory
switch permissions.Type {
case types.PermissionNamedEntities:
if len(permissions.UserIDs) == 0 {
clients.IO.PrintWarning(ctx, fmt.Sprintf(
"No users will have access to '%s'",
clients.IO.PrintWarning(ctx, "No users will have access to '%s'",
function,
))
)
}
err := updateNamedEntitiesDistribution(ctx, clients, app, function, permissions.UserIDs)
if err != nil {
return err
}
default:
if len(permissions.UserIDs) != 0 {
clients.IO.PrintWarning(ctx, fmt.Sprintf(
"The supplied user IDs to '%s' are overridden by the '%s' permission",
clients.IO.PrintWarning(ctx, "The supplied user IDs to '%s' are overridden by the '%s' permission",
function,
permissions.Type,
))
)
}
_, err := clients.API().FunctionDistributionSet(ctx, function, app.AppID, permissions.Type, "")
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/manifest/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func runInfoCommand(cmd *cobra.Command, clients *shared.ClientFactory) error {
if err != nil {
return err
}
clients.IO.PrintInfo(ctx, false, string(manifest))
clients.IO.PrintInfo(ctx, false, "%s", string(manifest))
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/manifest/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func NewValidateCommand(clients *shared.ClientFactory) *cobra.Command {
return err
}
if warn != nil {
clients.IO.PrintWarning(ctx, warn.Warning(clients.Config.DebugEnabled, "The following warnings were raised during manifest validation"))
clients.IO.PrintWarning(ctx, "%s", warn.Warning(clients.Config.DebugEnabled, "The following warnings were raised during manifest validation"))
return nil
}
if log != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/platform/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func printDeployHostingCompletion(clients *shared.ClientFactory, cmd *cobra.Comm
},
})

clients.IO.PrintInfo(ctx, false, navigateText)
clients.IO.PrintInfo(ctx, false, "%s", navigateText)
return nil
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/project/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func printCreateSuccess(ctx context.Context, clients *shared.ClientFactory, appP

// Include documentation and information about ROSI for deno apps
if isDenoProject {
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "compass",
Text: "Explore the documentation to learn more",
Secondary: []string{
Expand All @@ -245,7 +245,7 @@ func printCreateSuccess(ctx context.Context, clients *shared.ClientFactory, appP
},
}))

clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "clipboard",
Text: "Follow the steps below to begin development",
Secondary: []string{
Expand All @@ -268,7 +268,7 @@ func printCreateSuccess(ctx context.Context, clients *shared.ClientFactory, appP
"Start developing and see changes in real-time with "+style.Commandf("run", true),
)

clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "clipboard",
Text: "Next steps to begin development",
Secondary: secondaryOutput,
Expand Down
4 changes: 2 additions & 2 deletions cmd/project/create_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func confirmExternalTemplateSelection(cmd *cobra.Command, clients *shared.Client
return true, nil
}

clients.IO.PrintWarning(ctx, style.Sectionf(style.TextSection{
clients.IO.PrintWarning(ctx, "%s", style.Sectionf(style.TextSection{
Text: style.Bold("You are trying to use code published by an unknown author"),
Secondary: []string{
"We strongly advise reviewing the source code and dependencies of external",
Expand Down Expand Up @@ -267,7 +267,7 @@ func listTemplates(ctx context.Context, clients *shared.ClientFactory, categoryS
for i, tmpl := range templates {
secondary[i] = tmpl.Repository
}
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "house_buildings",
Text: style.Bold(category.name),
Secondary: secondary,
Expand Down
4 changes: 2 additions & 2 deletions cmd/project/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func projectInitCommandRunE(clients *shared.ClientFactory, cmd *cobra.Command, a
err = app.LinkExistingApp(ctx, clients, &types.App{}, true)
if err != nil {
// Display the error but continue to init
clients.IO.PrintError(ctx, err.Error())
clients.IO.PrintError(ctx, "%s", err.Error())
}

printNextStepSection(ctx, clients, projectDirPath)
Expand All @@ -141,7 +141,7 @@ func printNextStepSection(ctx context.Context, clients *shared.ClientFactory, pr
"When you're ready to deploy for production with "+style.Commandf("deploy", true),
)

clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "clipboard",
Text: "Next steps to begin development",
Secondary: secondaryOutput,
Expand Down
Loading
Loading