mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-31 03:58:11 -04:00
fix(pacquet): satisfy perfectionist dylint lints
- Use raw strings for the shlex escape and the no-placeholder display / help messages that contained `\"` escapes (perfectionist::prefer_raw_string). - Add the trailing comma to the multi-line format! in the run listing (perfectionist::macro_trailing_comma). https://claude.ai/code/session_01PPwhryEFfN4iyZkVsjy2Hf
This commit is contained in:
@@ -58,7 +58,7 @@ pub enum DlxError {
|
||||
#[diagnostic(code(ERR_PNPM_DLX_MISSING_COMMAND))]
|
||||
MissingCommand,
|
||||
|
||||
#[display("dlx was unable to find the installed dependency in \"dependencies\"")]
|
||||
#[display(r#"dlx was unable to find the installed dependency in "dependencies""#)]
|
||||
#[diagnostic(code(ERR_PNPM_DLX_NO_DEP))]
|
||||
NoDep,
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ pub enum RunError {
|
||||
#[display("Script \"{script}\" is hidden and cannot be run directly")]
|
||||
#[diagnostic(
|
||||
code(ERR_PNPM_HIDDEN_SCRIPT),
|
||||
help("Scripts starting with \".\" are hidden and can only be called from other scripts.")
|
||||
help(r#"Scripts starting with "." are hidden and can only be called from other scripts."#)
|
||||
)]
|
||||
HiddenScript { script: String },
|
||||
}
|
||||
@@ -281,7 +281,7 @@ fn render_project_commands(manifest: &PackageManifest) -> String {
|
||||
}
|
||||
output.push_str(&format!(
|
||||
"Commands available via \"pnpm run\":\n{}",
|
||||
render_commands(&other)
|
||||
render_commands(&other),
|
||||
));
|
||||
}
|
||||
output
|
||||
|
||||
@@ -169,7 +169,7 @@ fn posix_quote(arg: &str) -> String {
|
||||
return "''".to_string();
|
||||
}
|
||||
let safe = arg.chars().all(|ch| ch.is_ascii_alphanumeric() || "_@%+=:,./-".contains(ch));
|
||||
if safe { arg.to_string() } else { format!("'{}'", arg.replace('\'', "'\"'\"'")) }
|
||||
if safe { arg.to_string() } else { format!("'{}'", arg.replace('\'', r#"'"'"'"#)) }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user