The Rust CLI ships as `pnpm`; `pacquet` survives only as the in-repo package identifier that keeps the npm wrapper from colliding with the TypeScript CLI's name. Carrying that identifier into all 75 Cargo crate names made every `use` statement and every `cargo nextest run -p ...` spell a name users never see. This renames the crates to the product they belong to. Mechanical, name-only: package/lib/bin names, the root `[workspace.dependencies]` keys, every dependency entry, and every Rust path reference. All the crates are `publish = false`, so nothing about the released artifacts changes and no changeset is needed. Also updated the tooling and docs that spell crate names: the `codecov` cargo alias, the `registry-mock` just recipe, the release workflow's `-p` targets and `libpnpm_napi.*` artifact paths, the `libpacquet` -> `libpnpm` cspell dictionary entry, and the crate names quoted across `AGENTS.md`, `CONTRIBUTING.md`, `CODE_STYLE_GUIDE.md`, and the plans. Two spots needed more than a token swap. The five insta snapshot files carry the crate name in their filename, since insta derives it from the module path, so they are renamed too — otherwise the tests fail with "snapshot not found" rather than a diff. And the private module in `pnpm-lockfile-verification` that mirrors the npm verifier's violation codes is named after the crate it shadows, so it moved with it. Two knock-on fixes: the shorter names let rustfmt fit three macro invocations onto one line, where `perfectionist::macro_trailing_comma` rejects the trailing comma that was legal while they were wrapped; and the `libpacquet` cspell entry became `libpnpm` for the NAPI addon's shared library. Left alone deliberately, none of which are crate names: the product name in prose and in the changeset package identifier, the `--pacquet` benchmark flag and testbed IDs, test helpers and temp-dir prefixes (`pacquet-test-*`, `../pacquet-store`), the released changesets that quote error codes shipped versions actually emitted, the `.github/workflows/pacquet-*.yml` filenames, and the `@pnpm-private/pacquet-registry-mock-launcher` npm package.
104 lines
3.8 KiB
TOML
104 lines
3.8 KiB
TOML
# Dylint configuration. cargo-dylint reads `[workspace.metadata.dylint]`
|
|
# from this file (or, equivalently, from `Cargo.toml`). Keeping the table
|
|
# here keeps the workspace `Cargo.toml` focused on cargo-native metadata
|
|
# and makes the cache key for CI easy to compute (see the `dylint` job
|
|
# in `.github/workflows/ci.yml`).
|
|
#
|
|
# Run with: `cargo dylint --all -- --all-targets --workspace`
|
|
# or via the `just dylint` recipe.
|
|
[workspace.metadata.dylint]
|
|
libraries = [
|
|
{ git = "https://github.com/KSXGitHub/perfectionist", tag = "0.0.0-rc.22" },
|
|
]
|
|
|
|
# Project-local DSL / test macros that perfectionist's exactly-once
|
|
# heuristic cannot peer through. perfectionist's built-in allow set already
|
|
# covers `concat!`, `json!`, and the `assert_*_snapshot!` family, so they
|
|
# do not need to be repeated here.
|
|
["perfectionist::impure_macro_arguments"]
|
|
ignore = [
|
|
# `pnpm_testing_utils::allow_known_failure!` binds its argument
|
|
# to a `let` internally before the match, so the expression is
|
|
# evaluated exactly once. The rule cannot peer through the macro
|
|
# body to see that.
|
|
"allow_known_failure",
|
|
# Test-local `static_env!` (in `npmrc_auth/tests.rs`) generates an
|
|
# `EnvVar` impl. The `&[(...)]` slice expression it receives binds
|
|
# to a local inside the impl, evaluated once on each `var(name)`
|
|
# call.
|
|
"static_env",
|
|
# Test-local `case!` (in `pkg_*_*/tests.rs`) takes
|
|
# `$input:expr, $message:expr, $variant:pat`. The lint sees the
|
|
# `$variant` slot's token stream as a non-trivial expression even
|
|
# though it's parsed as a pattern. The macro binds `$input` to a
|
|
# local on entry, so the exactly-once contract holds.
|
|
"case",
|
|
# `rusqlite::params!` is a DSL macro that wraps each arg as a
|
|
# `&dyn ToSql` reference. Args carry no side effects (they are
|
|
# already references / borrows that the macro forwards once);
|
|
# hoisting to a `let` is purely noise.
|
|
"params",
|
|
]
|
|
|
|
[perfectionist]
|
|
enable = ["unordered_derives"]
|
|
disable = [
|
|
"needless_borrowed_parameters",
|
|
]
|
|
|
|
# Code spans read fine in `--help` and stay useful as `cargo doc` docs, so
|
|
# keep them; links and HTML remain forbidden and are cleaned from help text.
|
|
["perfectionist::clap_help_markdown"]
|
|
ignore_constructs = ["code_span"]
|
|
|
|
# The codebase collapses imports to one `use` per crate root (shared
|
|
# prefixes in nested braces) — the same granularity rustfmt spells
|
|
# `imports_granularity = "Crate"` and perfectionist spells `"crate"`. Pin
|
|
# the rule to it; its default `module` style would flag every such import.
|
|
["perfectionist::import_granularity_mismatch"]
|
|
style = "crate"
|
|
|
|
# Every unit test lives in an external file (shorter production files,
|
|
# less churn). Flag any inline test item, not just the ones over a line
|
|
# budget.
|
|
["perfectionist::excessive_inline_tests"]
|
|
inline_style = "external_only"
|
|
|
|
# Don't rely on the doc-comment-only default: a bare `#NNN` is just as
|
|
# ambiguous in a plain `//` comment, so lint those too.
|
|
["perfectionist::bare_issue_reference"]
|
|
include_plain_comments = true
|
|
|
|
# Narrowed to names that resolve in the documenting item's own module,
|
|
# multi-word only. Widening tracked in
|
|
# <https://github.com/pnpm/pnpm/issues/12716>.
|
|
["perfectionist::bare_identifier_reference"]
|
|
reference_scope = "own_module"
|
|
min_words = 2
|
|
|
|
# Scan comments only: forge URLs in string literals are test data, not
|
|
# citations. `allow_version_patterns` accepts version-shaped release-tag
|
|
# citations without requiring a SHA.
|
|
["perfectionist::unpinned_repo_ref"]
|
|
scan_string_literals = false
|
|
allow_version_patterns = true
|
|
|
|
["perfectionist::unordered_derives"]
|
|
style = "prefix_then_alphabetical"
|
|
prefix = [
|
|
"Debug",
|
|
"Default",
|
|
"Display",
|
|
"Error",
|
|
"Diagnostic",
|
|
"Clone",
|
|
"Copy",
|
|
"PartialEq",
|
|
"Eq",
|
|
"PartialOrd",
|
|
"Ord",
|
|
"Hash",
|
|
"Serialize",
|
|
"Deserialize",
|
|
]
|