Skip to content

Conversation

@lukegalbraithrussell
Copy link
Contributor

Summary

This error has unescaped < in its description which our docs sites does not like.

Requirements

@lukegalbraithrussell lukegalbraithrussell requested a review from a team as a code owner June 19, 2025 21:29
@mwbrooks mwbrooks changed the title Docs: escapes < character in errors.go docs: escapes < character in errors.go Jun 19, 2025
@codecov
Copy link

codecov bot commented Jun 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.49%. Comparing base (b395fd1) to head (d91d3cb).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #135      +/-   ##
==========================================
+ Coverage   63.46%   63.49%   +0.02%     
==========================================
  Files         212      212              
  Lines       22345    22345              
==========================================
+ Hits        14182    14188       +6     
+ Misses       7080     7078       -2     
+ Partials     1083     1079       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

✅ Sounds good! We may have similar formatting issues in other error messages as well. 🤔 I left a suggestion that we may want to consider, since <arg> is common usage in CLI help messages and back ticks can be a dangerous character when copy & pasted in the terminal.

Message: "The name of the feedback is required",
Remediation: strings.Join([]string{
"Please provide a --name <string> flag or remove the --no-prompt flag",
"Please provide a `--name <string>` flag or remove the `--no-prompt` flag",
Copy link
Member

Choose a reason for hiding this comment

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

note: It's a new dimension for us to write error messages with markdown docs rendering in mind. We'll also want to ensure this always looks good on the terminal. Back ticks can be a dangerous character in the terminal when copy & pasted, but I agree that it reads well.

question: We may be able to update our slack docs command to render &nbsp; instead of < rather than adding backticks to our error messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh i just went ahead and added the backticks because i saw them in other errors -- if it creates issues i can add an exception on our docs-cleaning scripts instead. i was trying to avoid adding hardcoded examples in that for maintenance reasons, but if it actually affects terminal output possibilities then it seems like the better option!

Copy link
Member

Choose a reason for hiding this comment

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

👋 Adding to @mwbrooks suggestion - I lean towards improving docgen outputs with expected escaping for these cases!

But I do think this change makes the remediation more clear, FWIW.

Copy link
Member

Choose a reason for hiding this comment

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

@lukegalbraithrussell Totally cool! I think we should merge this PR because it immediately fixes the docs experience. We can create a task to improve the docgen command if we want to avoid adding back ticks to every occurrence of < and >. :shipit:

@mwbrooks mwbrooks added docs M-T: Documentation work only semver:patch Use on pull requests to describe the release version increment labels Jun 19, 2025
@mwbrooks mwbrooks added this to the Next Release milestone Jun 19, 2025
@zimeg zimeg changed the title docs: escapes < character in errors.go docs: surround remediation flags with backticks for prompted feedback Jun 19, 2025
Copy link
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

@lukegalbraithrussell LGTM! Thanks for finding and following up with this fix! 📚 ✨

Message: "The name of the feedback is required",
Remediation: strings.Join([]string{
"Please provide a --name <string> flag or remove the --no-prompt flag",
"Please provide a `--name <string>` flag or remove the `--no-prompt` flag",
Copy link
Member

Choose a reason for hiding this comment

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

👋 Adding to @mwbrooks suggestion - I lean towards improving docgen outputs with expected escaping for these cases!

But I do think this change makes the remediation more clear, FWIW.

@mwbrooks mwbrooks merged commit 9b0026d into main Jun 19, 2025
6 checks passed
@mwbrooks mwbrooks deleted the docs-escaping-characters branch June 19, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs M-T: Documentation work only semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants