Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use consistent formatting for build system errors #9340

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Nov 21, 2024

Summary

These look pretty different from the help / hint messages we show on resolver failure. I've added color, backticks, and a "hint:" prefix.

Before:

Screenshot 2024-11-21 at 5 45 40 PM

After:

Screenshot 2024-11-21 at 6 05 31 PM

@@ -1105,7 +1105,7 @@ impl std::fmt::Display for PubGrubHint {
Self::InvalidPackageMetadata { package, reason } => {
write!(
f,
"{}{} Metadata for {} could not be parsed:\n{}",
"{}{} Metadata for `{}` could not be parsed:\n{}",
"hint".bold().cyan(),
":".bold(),
package.bold(),
Copy link
Member Author

Choose a reason for hiding this comment

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

Should the package names be cyan? In the build failures, they're now cyan (but not bold)... But here, they're just bold.

@charliermarsh charliermarsh force-pushed the charlie/format branch 4 times, most recently from 974bb3d to 4a5cd25 Compare November 22, 2024 03:02
@@ -1068,7 +1068,7 @@ impl std::fmt::Display for PubGrubHint {
Self::PrereleaseRequested { package, range } => {
write!(
f,
"{}{} {} was requested with a pre-release marker (e.g., {}), but pre-releases weren't enabled (try: `{}`)",
"{}{} `{}` was requested with a pre-release marker (e.g., {}), but pre-releases weren't enabled (try: `{}`)",
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe this is bad? We don't use backticks around the package name in the PubGrub error message (just this hint, now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant