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:
Claude
2026-05-26 01:47:32 +00:00
parent 361119675e
commit 61ae2db3dc
3 changed files with 4 additions and 4 deletions

View File

@@ -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,

View File

@@ -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

View File

@@ -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)]