Files
pnpm/dylint.toml
T
KhảiandClaude Opus 4.8 e9433b130d chore(rust/dylint): enable perfectionist::unpinned_repo_ref (#13192)
* chore(dylint): re-enable perfectionist::unpinned_repo_ref

The rule flags repository URLs in comments whose ref is a mutable branch
or tag instead of a commit SHA. It was disabled while its citations were
pinned; re-enable it and bring the tree into conformance.

dylint.toml:
- Remove unpinned_repo_ref from the disable list.
- scan_string_literals = false: forge URLs in string literals are runtime
  data, not citations. The `pnpm repo` / `pnpm list` output URLs asserted
  in repo/tests.rs and list.rs are branch-shaped by design.
- allow_version_patterns = true: accept citations to permanent release
  tags (hosted-git-info v4.1.0, object-hash v3.0.0), where the version
  number is the meaningful reference.

SHA-pin the branch-ref citations to their current branch HEADs:
- zkochan/packages main -> e65701a6ae (is-subdir, path-temp,
  rename-overwrite)
- npm/registry -> ae49abf1ba (package-metadata.md)
- ds300/patch-package master -> be4dfd77d9 (applyPatches.ts)

Replace the pnpm/pnpm self-citations with in-repo pnpm11/ path
references: now that pacquet lives inside pnpm/pnpm, a link to pnpm/pnpm
source is no longer an upstream citation.

Verified locally: cargo dylint (clean), cargo doc, cargo fmt --check,
cargo clippy, and typos.

Resolves pnpm/pnpm#12717.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpWbXY1p1KHvZ2h95jyza6

* chore(dylint): trim unpinned_repo_ref config comment

Shorten the comment to match the surrounding config style and drop the
file paths and package@version references that would drift as the tree
changes. The config values are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpWbXY1p1KHvZ2h95jyza6

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-21 13:28:52 +02:00

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 = [
# `pacquet_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",
]