Skip to content

Commit

Permalink
Use backticks for code in red-knot messages
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Oct 2, 2024
1 parent ef45185 commit d0a18b0
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 91 deletions.
2 changes: 1 addition & 1 deletion crates/red_knot/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ fn run() -> anyhow::Result<ExitStatus> {
SystemPathBuf::from_path_buf(cwd)
.map_err(|path| {
anyhow!(
"The current working directory '{}' contains non-unicode characters. Red Knot only supports unicode paths.",
"The current working directory `{}` contains non-Unicode characters. Red Knot only supports Unicode paths.",
path.display()
)
})?
Expand Down
2 changes: 1 addition & 1 deletion crates/red_knot/tests/file_watching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ where

let root_path = SystemPath::from_std_path(temp_dir.path()).ok_or_else(|| {
anyhow!(
"Temp directory '{}' is not a valid UTF-8 path.",
"Temporary directory `{}` is not a valid UTF-8 path.",
temp_dir.path().display()
)
})?;
Expand Down
6 changes: 3 additions & 3 deletions crates/red_knot_python_semantic/src/site_packages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl VirtualEnvironment {
} else {
tracing::warn!(
"Failed to resolve `sys.prefix` of the system Python installation \
from the `home` value in the `pyvenv.cfg` file at '{}'. \
from the `home` value in the `pyvenv.cfg` file at `{}`. \
System site-packages will not be used for module resolution.",
venv_path.join("pyvenv.cfg")
);
Expand Down Expand Up @@ -426,7 +426,7 @@ impl Deref for SysPrefixPath {

impl fmt::Display for SysPrefixPath {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "`sys.prefix` path '{}'", self.0)
write!(f, "`sys.prefix` path `{}`", self.0)
}
}

Expand Down Expand Up @@ -483,7 +483,7 @@ impl Deref for PythonHomePath {

impl fmt::Display for PythonHomePath {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "`home` location '{}'", self.0)
write!(f, "`home` location `{}`", self.0)
}
}

Expand Down
8 changes: 4 additions & 4 deletions crates/red_knot_python_semantic/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ impl<'db> CallOutcome<'db> {
node,
"call-non-callable",
format_args!(
"Object of type '{}' is not callable.",
"Object of type `{}` is not callable.",
not_callable_ty.display(db)
),
);
Expand All @@ -932,7 +932,7 @@ impl<'db> CallOutcome<'db> {
node,
"call-non-callable",
format_args!(
"Object of type '{}' is not callable (due to union element '{}').",
"Object of type `{}` is not callable (due to union element `{}`).",
called_ty.display(db),
not_callable_ty.display(db),
),
Expand All @@ -948,7 +948,7 @@ impl<'db> CallOutcome<'db> {
node,
"call-non-callable",
format_args!(
"Object of type '{}' is not callable (due to union elements {}).",
"Object of type `{}` is not callable (due to union elements {}).",
called_ty.display(db),
not_callable_tys.display(db),
),
Expand All @@ -974,7 +974,7 @@ impl<'db> CallOutcome<'db> {
builder.add_diagnostic(
node,
"revealed-type",
format_args!("Revealed type is '{}'.", revealed_ty.display(db)),
format_args!("Revealed type is `{}`.", revealed_ty.display(db)),
);
Ok(*return_ty)
}
Expand Down
Loading

0 comments on commit d0a18b0

Please sign in to comment.