Skip to content

Commit 32ede49

Browse files
authored
Merge branch 'main' into ale-feat-subdir-flag
2 parents 03222ca + 62770ba commit 32ede49

45 files changed

Lines changed: 291 additions & 165 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
default: "dev-build"
114114
docker: # run the steps with Docker
115115
# CircleCI Go images available at: https://hub.docker.com/r/circleci/golang/
116-
- image: cimg/go:1.25.7
116+
- image: cimg/go:1.26.0
117117
steps: # steps that comprise the `build` job
118118
- checkout # check out source code to working directory
119119
- restore_cache: # restores saved cache if no changes are detected since last run

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up Go
2626
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
2727
with:
28-
go-version: "1.25.7"
28+
go-version: "1.26.0"
2929
- name: Lint
3030
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
3131
with:
@@ -57,7 +57,7 @@ jobs:
5757
- name: Set up Go
5858
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
5959
with:
60-
go-version: "1.25.7"
60+
go-version: "1.26.0"
6161
- name: Report health score
6262
uses: slackapi/slack-health-score@d58a419f15cdaff97e9aa7f09f95772830ab66f7 # v0.1.1
6363
with:

cmd/app/add.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func RunAddCommand(ctx context.Context, clients *shared.ClientFactory, selection
127127
}
128128
clients.Config.Flags.Lookup("environment").Changed = true
129129

130-
clients.IO.PrintInfo(ctx, false, "\n"+style.Sectionf(style.TextSection{
130+
clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{
131131
Emoji: "warning",
132132
Text: "Warning: Default App Environment",
133133
Secondary: []string{

cmd/app/app.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
package app
1616

1717
import (
18-
"fmt"
19-
2018
"github.com/slackapi/slack-cli/internal/cmdutil"
2119
"github.com/slackapi/slack-cli/internal/shared"
2220
"github.com/slackapi/slack-cli/internal/style"
@@ -51,13 +49,13 @@ func NewCommand(clients *shared.ClientFactory) *cobra.Command {
5149
ctx := cmd.Context()
5250
// DEPRECATED(semver:major): remove the "workspace" alias
5351
if cmd.CalledAs() == "workspace" {
54-
clients.IO.PrintInfo(ctx, false, fmt.Sprintf(
52+
clients.IO.PrintInfo(ctx, false,
5553
"\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 ",
5654
style.Emoji("bulb"),
5755
style.Commandf("workspace", true),
5856
style.Commandf("app", true),
5957
style.Commandf("workspace", true),
60-
))
58+
)
6159
}
6260
return nil
6361
},

cmd/app/link.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func LinkExistingApp(ctx context.Context, clients *shared.ClientFactory, app *ty
214214
fmt.Sprintf(`manifest.source: "%s"`, config.ManifestSourceRemote),
215215
).
216216
WithRootCause(err)
217-
clients.IO.PrintError(ctx, slackErr.Error())
217+
clients.IO.PrintError(ctx, "%s", slackErr.Error())
218218
}
219219
}
220220

cmd/auth/login.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import (
1818
"context"
1919
"fmt"
2020

21+
"github.com/slackapi/slack-cli/internal/config"
22+
"github.com/slackapi/slack-cli/internal/experiment"
2123
"github.com/slackapi/slack-cli/internal/iostreams"
2224
authpkg "github.com/slackapi/slack-cli/internal/pkg/auth"
2325
"github.com/slackapi/slack-cli/internal/shared"
@@ -109,7 +111,7 @@ func RunLoginCommand(clients *shared.ClientFactory, cmd *cobra.Command) (types.S
109111
return types.SlackAuth{}, err
110112
}
111113
if selectedAuth.Token != "" {
112-
printAuthSuccess(cmd, clients.IO, credentialsPath, selectedAuth.Token)
114+
printAuthSuccess(cmd, clients.Config, clients.IO, credentialsPath, selectedAuth.Token)
113115
printAuthNextSteps(ctx, clients)
114116
}
115117
return selectedAuth, err
@@ -119,14 +121,14 @@ func RunLoginCommand(clients *shared.ClientFactory, cmd *cobra.Command) (types.S
119121
if err != nil {
120122
return types.SlackAuth{}, err
121123
} else {
122-
printAuthSuccess(cmd, clients.IO, credentialsPath, selectedAuth.Token)
124+
printAuthSuccess(cmd, clients.Config, clients.IO, credentialsPath, selectedAuth.Token)
123125
printAuthNextSteps(ctx, clients)
124126
}
125127

126128
return selectedAuth, nil
127129
}
128130

129-
func printAuthSuccess(cmd *cobra.Command, IO iostreams.IOStreamer, credentialsPath string, token string) {
131+
func printAuthSuccess(cmd *cobra.Command, config *config.Config, IO iostreams.IOStreamer, credentialsPath string, token string) {
130132
ctx := cmd.Context()
131133

132134
var secondaryLog string
@@ -136,7 +138,13 @@ func printAuthSuccess(cmd *cobra.Command, IO iostreams.IOStreamer, credentialsPa
136138
secondaryLog = fmt.Sprintf("Service token:\n\n %s\n\nMake sure to copy the token now and save it safely.", token)
137139
}
138140

139-
IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{
141+
// The legacy prompt leaves no blank line before the success message, so
142+
// print one here. The Charm-based prompt already handles spacing.
143+
if !config.WithExperimentOn(experiment.Charm) {
144+
IO.PrintInfo(ctx, false, "")
145+
}
146+
147+
IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
140148
Emoji: "key",
141149
Text: "You've successfully authenticated!",
142150
Secondary: []string{secondaryLog},
@@ -148,15 +156,15 @@ func printAuthSuccess(cmd *cobra.Command, IO iostreams.IOStreamer, credentialsPa
148156
func printAuthNextSteps(ctx context.Context, clients *shared.ClientFactory) {
149157
project, _ := clients.SDKConfig.Exists()
150158
if !project {
151-
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
159+
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
152160
Emoji: "bulb",
153161
Text: fmt.Sprintf("Get started by creating a new app with %s", style.Commandf("create my-app", true)),
154162
Secondary: []string{
155163
fmt.Sprintf("Explore the details of available commands with %s", style.Commandf("help", false)),
156164
},
157165
}))
158166
} else {
159-
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
167+
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
160168
Emoji: "bulb",
161169
Text: fmt.Sprintf("Review existing installations of the app with %s", style.Commandf("app list", false)),
162170
Secondary: []string{

cmd/auth/logout.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,11 @@ func printLogoutSuccess(ctx context.Context, clients *shared.ClientFactory, auth
212212
}
213213

214214
clients.IO.PrintTrace(ctx, slacktrace.AuthLogoutSuccess)
215-
clients.IO.PrintInfo(ctx, false, fmt.Sprintf("\n%s", style.Sectionf(style.TextSection{
215+
clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{
216216
Emoji: "wastebasket",
217217
Text: revokedAuthText,
218218
Secondary: logoutNextSteps,
219-
})))
219+
}))
220220
}
221221

222222
// FormatAuthLabel returns a formatted auth label for user selection during logout

cmd/auth/revoke.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ func printRevokeSuccess(ctx context.Context, clients *shared.ClientFactory) {
7272
}
7373

7474
clients.IO.PrintTrace(ctx, slacktrace.AuthRevokeSuccess)
75-
clients.IO.PrintInfo(ctx, false, fmt.Sprintf("\n%s", style.Sectionf(style.TextSection{
75+
clients.IO.PrintInfo(ctx, false, "\n%s", style.Sectionf(style.TextSection{
7676
Emoji: "wastebasket",
7777
Text: revokedAuthText,
7878
Secondary: logoutNextSteps,
79-
})))
79+
}))
8080
}

cmd/datastore/count.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func printCountResult(ctx context.Context, clients *shared.ClientFactory, countR
147147
clients.IO.PrintTrace(ctx, slacktrace.DatastoreCountSuccess)
148148
clients.IO.PrintTrace(ctx, slacktrace.DatastoreCountTotal, fmt.Sprintf("%d", countResult.Count))
149149
clients.IO.PrintTrace(ctx, slacktrace.DatastoreCountDatastore, countResult.Datastore)
150-
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
150+
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
151151
Emoji: "tada",
152152
Text: fmt.Sprintf(
153153
"Counted %d matching items from datastore: %s",
@@ -203,7 +203,7 @@ func promptDatastoreCountRequest(
203203

204204
// Display a hint for writing expressions
205205
clients.IO.PrintInfo(ctx, false, "")
206-
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
206+
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
207207
Emoji: "bulb",
208208
Text: "Expressions should use the following format",
209209
Secondary: []string{

cmd/datastore/datastore.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ func printDatastoreExpressionMarshal(ctx context.Context, clients *shared.Client
162162
return err
163163
}
164164
clients.IO.PrintInfo(ctx, false, "")
165-
clients.IO.PrintInfo(ctx, false, style.Sectionf(style.TextSection{
165+
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
166166
Emoji: "open_file_folder",
167167
Text: "This expression can be represented by the following JSON:",
168168
}))
169-
clients.IO.PrintInfo(ctx, false, style.Secondary(expression))
169+
clients.IO.PrintInfo(ctx, false, "%s", style.Secondary(expression))
170170
return nil
171171
}
172172

0 commit comments

Comments
 (0)