Skip to content
Merged
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
22 changes: 15 additions & 7 deletions internal/slackerror/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,9 +806,13 @@ Otherwise start your app for local development with: %s`,
},

ErrInvalidAppDirectory: {
Code: ErrInvalidAppDirectory,
Message: "This is an invalid Slack app project directory",
Remediation: fmt.Sprintf("A valid Slack project includes the Slack hooks file: %s", filepath.Join(".slack", "hooks.json")),
Code: ErrInvalidAppDirectory,
Message: "This is an invalid Slack app project directory",
Remediation: strings.Join([]string{
fmt.Sprintf("A valid Slack project includes the Slack hooks file: %s", filepath.Join(".slack", "hooks.json")),
"",
"If this is a Slack project, you can initialize it with " + style.Commandf("init", false),
Comment on lines +813 to +814
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"",
"If this is a Slack project, you can initialize it with " + style.Commandf("init", false),
"You can initialize an existing Slack project with the " + style.Commandf("init", false) + " command",

I like the wording to the reader! I made a similar line removal here with some adjusted words, but might want to discuss the extra line more. Without having a similar suggestion heading this feels somewhat out of place to me...

Not meaning to block this from merging but am also hoping to lean into fewer linebreaks in output overall? It's at least interesting to me.

}, "\n"),
},

ErrInvalidAppFlag: {
Expand Down Expand Up @@ -1292,12 +1296,16 @@ Otherwise start your app for local development with: %s`,
Code: ErrSDKHookNotFound,
Message: fmt.Sprintf("A script in %s was not found", style.Highlight(filepath.Join(".slack", "hooks.json"))),
Remediation: strings.Join([]string{
fmt.Sprintf("Hook scripts are defined in the Slack hooks file ('%s').", filepath.Join(".slack", "hooks.json")),
"Every app requires a Slack hooks file and you can find a working example at:",
"Hook scripts are defined in one of these Slack hooks files:",
"- slack.json",
"- " + filepath.Join(".slack", "hooks.json"),
Copy link
Member

Choose a reason for hiding this comment

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

🎉 Love the filepath support here!

"",
"Every app requires a Slack hooks file and you can find an example at:",
style.Highlight("https://github.com/slack-samples/deno-starter-template/blob/main/slack.json"),
"",
style.Highlight("https://github.com/slack-samples/deno-starter-template/blob/main/.slack/hooks.json"),
"You can create a hooks file manually or with the " + style.Commandf("init", false) + " command.",
"",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"",

Nit: IMO newlines between some of these details separates some related ideas, but these might be helpful for parsing outputs... 👁️‍🗨️

No blocker but removing some might be interesting!

Copy link
Member Author

Choose a reason for hiding this comment

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

I hear ya on too much separation, but I think it's important to leave a newline after a URL when possible. Depending on the person's terminal, the URL may not be styled and may wrap to multiple lines. So, leaving some whitespace after the URL can help it stand out and make the entire sentence more readable.

For example, here is a smaller window size. I've merged the previous suggestion to remove the whitespace before the URL. However, if we removed the whitespace after, it will become very unreadable:
image

"After creating the hooks file, you must install related hook dependencies.",
"When manually creating the hooks file, you must install the hook dependencies.",
}, "\n"),
},

Expand Down
Loading