Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.

chore(dylint): bump perfectionist to 0.0.0-rc.12, trim style rules#519

Draft
KSXGitHub wants to merge 4 commits into
mainfrom
claude/upgrade-perfectionist-linter-uGRI0
Draft

chore(dylint): bump perfectionist to 0.0.0-rc.12, trim style rules#519
KSXGitHub wants to merge 4 commits into
mainfrom
claude/upgrade-perfectionist-linter-uGRI0

Conversation

@KSXGitHub
Copy link
Copy Markdown
Contributor

@KSXGitHub KSXGitHub commented May 14, 2026

Summary

Bump perfectionist from 0.0.0-rc.7 to 0.0.0-rc.12 and trim style rules that the new lints now enforce.

rc.12 adds nine new lints, four of which overlap with prose in CODE_STYLE_GUIDE.md:

  • single_letter_generic, single_letter_function_param, single_letter_closure_param, single_letter_let_binding replace the "Generic Parameter Naming" and "Variable and Closure Parameter Naming" sections.
  • arc_rc_clone replaces the "Cloning Arc and Rc" section.

Those sections are collapsed into one-line pointers to the perfectionist rule pages, which already document the rationale, allowlists, and configuration knobs. The one nuance the lints don't cover — reserving i/j/k for index loops — is kept.

CONTRIBUTING.md gains a paragraph telling agents that cannot run cargo dylint in their sandbox to read rule descriptions from perfectionist's rules/ directory at the same git ref pinned in dylint.toml. The directory is auto-generated by gen-docs from the rule sources, so the docs always match the pinned behavior.

Net diff: +17 / −145.

Test plan

  • just ready passes locally (the sandbox preparing this PR lacked typos / nextest; cargo check and cargo fmt --check did pass)
  • CI Dylint job runs cleanly against 0.0.0-rc.12

Written by an agent (Claude Code, claude-opus-4-7).

…style rules

rc.12 added rules that now enforce policies previously described only in
CODE_STYLE_GUIDE.md:

- `single_letter_generic`, `single_letter_function_param`,
  `single_letter_closure_param`, `single_letter_let_binding` cover the
  "Generic Parameter Naming" and "Variable and Closure Parameter Naming"
  sections.
- `arc_rc_clone` covers the "Cloning `Arc` and `Rc`" section.

Replace those sections with brief pointers to the perfectionist rule
docs; the rule pages already explain the rationale, allowlists, and
configuration knobs.

Also document the `rules/` directory in perfectionist's repository as a
fallback for AI agents that cannot run `cargo dylint` in their sandbox:
read the rule descriptions at the same git ref pinned in `dylint.toml`.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4358d6fe-b630-4b4b-bbd7-815e8adc6cd4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/upgrade-perfectionist-linter-uGRI0

Comment @coderabbitai help to get the list of available commands and usage tips.

claude added 3 commits May 14, 2026 07:18
…ros for rc.12

perfectionist 0.0.0-rc.12 ships four new single-letter rules that fire
across the workspace, plus `prefer_raw_string`, `arc_rc_clone`, and a
stricter `macro_argument_binding`. Bringing the codebase green:

Renames (descriptive over single-letter — the policy
`CODE_STYLE_GUIDE.md` already documented):

- Workspace-wide: `<R: Reporter>` → `<Reporter: self::Reporter>` on the
  ~50 generic-fn sites that emit log events. `Reporter` shadows the
  trait of the same name within each fn; `self::Reporter` disambiguates
  the bound. Added a TODO on the trait def to revert to `<R: Reporter>`
  once perfectionist gains an `extra_allowed_idents` knob for generic
  type parameters.
- Other generics: `T`/`K`/`V`/`I`/`S`/`D`/`E`/`H`/`F` → descriptive
  names (`Node`, `Key`, `Value`, `Iter`, `Spec`, `Ser`/`De`/`DeError`,
  `Hasher`, `Inner`, `Lookup`, …).
- Function/closure parameters and `let` bindings — `s` → `text`/`path`/
  `os_str`/etc., `e` → `event`/`error`/`entry`, `m` → `meta`/`map`/`msg`,
  `r`/`w` → `reader`/`writer`, etc.
- `.0.clone()` on `Rc<…>` rewritten as explicit `Rc::clone(&…)`
  (`arc_rc_clone`).
- A handful of `"…\"…\\…"` literals converted to raw strings
  (`prefer_raw_string`).
- One `debug_assert_eq!(name, format!(…))` wrapped in
  `#[cfg(debug_assertions)]` so the `format!` call doesn't get hoisted
  into release builds (`macro_argument_binding`).

Per-rule configuration in `dylint.toml`'s
`["perfectionist::macro_argument_binding"]` table — DSL / compile-time /
local macros where the rule's "exactly-once evaluation" heuristic is a
false positive: `json`, `concat`, the `insta` `assert_*_snapshot`
family, `allow_known_failure`, `static_env`, `case`, `rusqlite::params`.
main landed two slices of #438 (hoisted node-linker — fe27251 wires
hoisted into the install pipeline, d0cf2b1 re-enables `BuildModules`
under hoisted) while this branch had renamed every `<R: Reporter>`
site to `<Reporter: self::Reporter>` for `perfectionist::single_letter_generic`.
The textual conflicts are all the new emit/run sites the slices
introduced (`InstallPackageBySnapshot::run`, the `if !is_hoisted` gate
around `SymlinkDirectDependencies`, the hoisted-branch `link_hoisted_modules::<R>`
call, the warm-snapshot `emit_warm_snapshot_progress::<R>` loop, and
the new `Install::run` 3-tuple with `hoisted_locations`).

Resolution: take main's new structure verbatim, then re-apply this
branch's `R → Reporter` rename to every new site. Same treatment for
the short closure params main added (`|s|`, `|c|` in
`bin_dirs_in_all_parent_dirs`) — renamed to `|text|` / `|ch|` to keep
`single_letter_closure_param` quiet.

`cargo dylint --all -- --all-targets --workspace` is clean post-merge.
The single-letter-identifier renames pushed in 4758246 stretched some
lines past rustfmt's column limit; `cargo fmt` re-wraps them into
multi-line arg/where/closure-body forms. Also adds the trailing comma
`perfectionist::macro_trailing_comma` wanted on the one assert! that
fmt's body-break exposed.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 83.96226% with 119 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.58%. Comparing base (fe27251) to head (efdcd91).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/store-dir/src/msgpackr_records.rs 68.58% 71 Missing ⚠️
crates/tarball/src/lib.rs 64.44% 16 Missing ⚠️
...package-manager/src/install_package_by_snapshot.rs 53.33% 7 Missing ⚠️
crates/executor/src/lifecycle.rs 80.00% 6 Missing ⚠️
crates/package-manager/src/create_virtual_store.rs 82.14% 5 Missing ⚠️
crates/package-manager/src/link_file.rs 81.81% 4 Missing ⚠️
crates/real-hoist/src/lib.rs 60.00% 4 Missing ⚠️
...tes/package-manager/src/install_frozen_lockfile.rs 77.77% 2 Missing ⚠️
crates/config/src/lib.rs 92.30% 1 Missing ⚠️
crates/git-fetcher/src/packlist.rs 92.85% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #519      +/-   ##
==========================================
+ Coverage   88.51%   88.58%   +0.06%     
==========================================
  Files         125      125              
  Lines       13821    13948     +127     
==========================================
+ Hits        12234    12356     +122     
- Misses       1587     1592       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
tarball/download_dependency    1.00      6.1±0.20ms   711.7 KB/sec    1.03      6.3±1.35ms   692.3 KB/sec

@github-actions
Copy link
Copy Markdown

Integrated-Benchmark Report (Linux)

Scenario: Frozen Lockfile

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.583 ± 0.098 2.422 2.722 1.01 ± 0.05
pacquet@main 2.561 ± 0.075 2.404 2.651 1.00
pnpm 5.768 ± 0.059 5.690 5.882 2.25 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5828555136799998,
      "stddev": 0.09759504114688111,
      "median": 2.57836841518,
      "user": 2.5737847799999996,
      "system": 3.5756884199999996,
      "min": 2.42161205318,
      "max": 2.72244870818,
      "times": [
        2.72244870818,
        2.60010888518,
        2.48672437618,
        2.50884488118,
        2.63930324718,
        2.54008225418,
        2.70814662918,
        2.42161205318,
        2.55662794518,
        2.64465615718
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.56052778368,
      "stddev": 0.07515076379121839,
      "median": 2.56527608818,
      "user": 2.58172518,
      "system": 3.5605434199999997,
      "min": 2.40443120618,
      "max": 2.65116095518,
      "times": [
        2.50217761118,
        2.61903565618,
        2.60712051218,
        2.55309265918,
        2.50190477618,
        2.40443120618,
        2.65116095518,
        2.57007947118,
        2.56047270518,
        2.63580228418
      ]
    },
    {
      "command": "pnpm",
      "mean": 5.768430994379999,
      "stddev": 0.05949517186488222,
      "median": 5.75299010768,
      "user": 8.38484478,
      "system": 4.33721582,
      "min": 5.69048519718,
      "max": 5.88220705618,
      "times": [
        5.78243977318,
        5.69048519718,
        5.88220705618,
        5.75278328518,
        5.70347680218,
        5.74782378718,
        5.75319693018,
        5.8524901411800005,
        5.74742783318,
        5.77197913818
      ]
    }
  ]
}

Scenario: Frozen Lockfile (Hot Cache)

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 736.1 ± 62.1 703.4 906.9 1.00
pacquet@main 772.3 ± 46.5 716.9 851.4 1.05 ± 0.11
pnpm 2467.2 ± 101.7 2364.3 2622.5 3.35 ± 0.31
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.7360814779000001,
      "stddev": 0.06208170309115531,
      "median": 0.7141001301000001,
      "user": 0.37284668,
      "system": 1.6273966999999998,
      "min": 0.7033870491,
      "max": 0.9069159221,
      "times": [
        0.9069159221,
        0.7073254031000001,
        0.7077843071000001,
        0.7033870491,
        0.7247878351000001,
        0.7046253991000001,
        0.7544431101000001,
        0.7204159531000001,
        0.7040580191000001,
        0.7270717811
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.7722869769,
      "stddev": 0.046450712571085795,
      "median": 0.7665422226,
      "user": 0.37705078,
      "system": 1.6361754000000002,
      "min": 0.7168681771000001,
      "max": 0.8513807411000001,
      "times": [
        0.7917727641000001,
        0.8315094181000001,
        0.7360115661000001,
        0.7168681771000001,
        0.7409375831000001,
        0.8513807411000001,
        0.7242679111000001,
        0.7450729281000001,
        0.7880115171000001,
        0.7970371631000001
      ]
    },
    {
      "command": "pnpm",
      "mean": 2.467208736999999,
      "stddev": 0.10174202668404508,
      "median": 2.4585376476,
      "user": 2.8177287800000004,
      "system": 2.2126295,
      "min": 2.3642513961,
      "max": 2.6225393810999997,
      "times": [
        2.5124659991000002,
        2.5172377771,
        2.6225393810999997,
        2.5561599931,
        2.3777703771,
        2.3644494051,
        2.3642513961,
        2.3682997301,
        2.5843040151,
        2.4046092961
      ]
    }
  ]
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants