Repository navigation
Conversation
Pin the pnpm rustfmt fork, integrate its cached wrapper into local and CI checks, and apply the chain and destructuring layout across the workspace. Refactor functions and modules that exceed existing lint limits after formatting and fix macro comma violations. Related to #14562.
|
Too many files changed for review (1868 files, 100 file limit). |
|
Important Review skippedToo many files! This PR contains 1868 files, which is 1568 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1868)
You can disable this status message by setting the |
PR Summary by QodoAdopt pinned complexity-aware Rust formatter
AI Description
Diagram
High-Level Assessment
Files changed (40)
|
Code Review by Qodo
1. Formatter reruns reinstall toolchains
|
| if (!component.startsWith('cargo-')) return false | ||
| const host = component.slice('cargo-'.length) | ||
| return ['rustc', 'rustc-dev', 'llvm-tools'].every(name => components.has(`${name}-${host}`)) |
There was a problem hiding this comment.
1. Formatter reruns reinstall toolchains 🐞 Bug ➹ Performance
hasRequiredComponents requires llvm-tools-${host}, while ensureInstallation installs the
component named llvm-tools-preview. The component check runs before the cached formatter binaries
are accepted, so CI, local formatting, and pre-push invocations attempt a redundant toolchain
install even after a successful cached installation.
Agent Prompt
Issue description
`hasRequiredComponents()` checks for `llvm-tools-${host}`, but the wrapper installs `llvm-tools-preview`, causing the cached toolchain check to fail on every normal installation.
Fix Focus Areas
- pnpm/scripts/rustfmt.mjs[66-72]
- pnpm/scripts/rustfmt.test.mjs[13-13]
Recommended Fix
Require `llvm-tools-preview-${host}` in `hasRequiredComponents()` (or otherwise match rustup's installed-component name), and update the test fixture to use that actual component name. Add or adjust the cache-hit test so it verifies no `toolchain install` command is run when the installed-component listing contains the required components.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
PR Code Suggestions ✨Warning
|
|||||||||
Micro-Benchmark ResultsLinux |
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4331195062799997,
"stddev": 0.13351695258404997,
"median": 2.4412962820799997,
"user": 1.2258326599999998,
"system": 1.45251174,
"min": 2.23763453708,
"max": 2.61928168108
},
{
"command": "pacquet@main",
"mean": 2.3817941550799997,
"stddev": 0.126644346236532,
"median": 2.37403496458,
"user": 1.15021186,
"system": 1.3775784400000002,
"min": 2.21978179108,
"max": 2.55878034608
},
{
"command": "pnpr@HEAD",
"mean": 1.4074051081800003,
"stddev": 0.08629900079077257,
"median": 1.4072151375800002,
"user": 1.04999206,
"system": 1.2425514400000002,
"min": 1.2755140600800001,
"max": 1.5425656420800002
},
{
"command": "pnpr@main",
"mean": 1.43912207458,
"stddev": 0.07073242269196375,
"median": 1.4090400545800001,
"user": 1.05141176,
"system": 1.27833344,
"min": 1.3715779400800001,
"max": 1.57063486108
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.20155106316000002,
"stddev": 0.008977624037677195,
"median": 0.20099205806000003,
"user": 0.21365037999999997,
"system": 0.48901768,
"min": 0.18862323356000002,
"max": 0.21762663756000003
},
{
"command": "pacquet@main",
"mean": 0.21029137916,
"stddev": 0.01062852245743431,
"median": 0.20979918006000003,
"user": 0.22858448,
"system": 0.53090438,
"min": 0.19788405156000002,
"max": 0.23320294656
},
{
"command": "pnpr@HEAD",
"mean": 0.22778307746000004,
"stddev": 0.003020060763578498,
"median": 0.22864586906000003,
"user": 0.23687798,
"system": 0.5397422799999999,
"min": 0.22337703256000002,
"max": 0.23237293956000002
},
{
"command": "pnpr@main",
"mean": 0.21944196256,
"stddev": 0.009263415237851834,
"median": 0.21735718106000002,
"user": 0.20797698000000003,
"system": 0.52471348,
"min": 0.20889336156000002,
"max": 0.23526129656000003
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.010287149650028332,
"stddev": 0.0033682044580400933,
"median": 0.010639885820000002,
"user": 0.006373015014164305,
"system": 0.004503306515580738,
"min": 0.00591710582,
"max": 0.01693349682
},
{
"command": "pacquet@main",
"mean": 0.012383969655897439,
"stddev": 0.0015358821706239311,
"median": 0.012347421820000001,
"user": 0.007416771794871799,
"system": 0.005643701025641025,
"min": 0.00861569782,
"max": 0.016269563820000003
},
{
"command": "pnpr@HEAD",
"mean": 0.007195616480098528,
"stddev": 0.0018119652772148383,
"median": 0.00648550982,
"user": 0.00418978965517241,
"system": 0.0034842256157635457,
"min": 0.00584898782,
"max": 0.013721494820000001
},
{
"command": "pnpr@main",
"mean": 0.006472434692289161,
"stddev": 0.0002607382815487602,
"median": 0.00648625982,
"user": 0.0042459144578313275,
"system": 0.002661637108433736,
"min": 0.00589240882,
"max": 0.008234292820000001
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.006859342064761899,
"stddev": 0.0004083467812296788,
"median": 0.006807964560000001,
"user": 0.0041544768253968245,
"system": 0.0031232953650793655,
"min": 0.00600331456,
"max": 0.00831393056
},
{
"command": "pacquet@main",
"mean": 0.006781423052492497,
"stddev": 0.0006317295612188084,
"median": 0.006659645560000001,
"user": 0.004323660780780782,
"system": 0.0028441472672672678,
"min": 0.005991523560000001,
"max": 0.01066371056
},
{
"command": "pnpr@HEAD",
"mean": 0.006705685858550717,
"stddev": 0.0003800789005117971,
"median": 0.006672019560000001,
"user": 0.004430575652173911,
"system": 0.0026511310144927526,
"min": 0.005982186560000001,
"max": 0.00835034956
},
{
"command": "pnpr@main",
"mean": 0.006598429511298705,
"stddev": 0.00036654621804489695,
"median": 0.006567248060000001,
"user": 0.004242860519480519,
"system": 0.0027266779220779212,
"min": 0.005904990560000001,
"max": 0.00825100356
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.5135594418799996,
"stddev": 0.011051645090775932,
"median": 2.5105934770799996,
"user": 1.9184639199999995,
"system": 1.9829094399999996,
"min": 2.50126848658,
"max": 2.53385067458
},
{
"command": "pacquet@main",
"mean": 2.5087103978800003,
"stddev": 0.01632250096529634,
"median": 2.50970314458,
"user": 1.82758192,
"system": 2.03683574,
"min": 2.48082159758,
"max": 2.53326803258
},
{
"command": "pnpr@HEAD",
"mean": 1.4646988092799997,
"stddev": 0.0672083125137898,
"median": 1.43167528608,
"user": 1.18819512,
"system": 1.6566403399999998,
"min": 1.41614746858,
"max": 1.62896017758
},
{
"command": "pnpr@main",
"mean": 1.5868429857800002,
"stddev": 0.11151037462708374,
"median": 1.57871912908,
"user": 1.21259952,
"system": 1.6250083400000002,
"min": 1.4370516225799999,
"max": 1.76949676758
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.31349442990000004,
"stddev": 0.01877471389247345,
"median": 0.30802779720000006,
"user": 0.4713719600000001,
"system": 0.7091924599999999,
"min": 0.2960146482,
"max": 0.3566306502
},
{
"command": "pacquet@main",
"mean": 0.30901869660000003,
"stddev": 0.013894582633730682,
"median": 0.31097638720000004,
"user": 0.44432046000000003,
"system": 0.7045244599999999,
"min": 0.2893154402,
"max": 0.32657031820000004
},
{
"command": "pnpr@HEAD",
"mean": 0.2472199892,
"stddev": 0.007312635385509661,
"median": 0.2470366277,
"user": 0.19046516,
"system": 0.44621616,
"min": 0.2365211402,
"max": 0.2609191752
},
{
"command": "pnpr@main",
"mean": 0.24673968110000005,
"stddev": 0.00524861970338671,
"median": 0.2484214972,
"user": 0.19453846,
"system": 0.4476307599999999,
"min": 0.23832193820000003,
"max": 0.25431526520000003
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.59176552582,
"stddev": 0.019071507931279652,
"median": 1.59153139682,
"user": 0.8859427,
"system": 1.0740296800000002,
"min": 1.5601659013200002,
"max": 1.6173820573200002
},
{
"command": "pacquet@main",
"mean": 1.5718622881200002,
"stddev": 0.012958926034422839,
"median": 1.57156281832,
"user": 0.8548764999999999,
"system": 1.0517627800000002,
"min": 1.5520186073200002,
"max": 1.5955406733200002
},
{
"command": "pnpr@HEAD",
"mean": 0.28892156572000005,
"stddev": 0.009169376220230997,
"median": 0.28978671132,
"user": 0.23371109999999998,
"system": 0.5761773799999999,
"min": 0.27471899932,
"max": 0.30605956732
},
{
"command": "pnpr@main",
"mean": 0.28799499472,
"stddev": 0.005880539335774158,
"median": 0.28931043482,
"user": 0.24707939999999998,
"system": 0.5872322799999999,
"min": 0.27795392832,
"max": 0.29475449232
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.18671328411333335,
"stddev": 0.009652902104553848,
"median": 0.18736086778000002,
"user": 0.19157610666666666,
"system": 0.07266412666666665,
"min": 0.17126833978000003,
"max": 0.20030558978000002
},
{
"command": "pacquet@main",
"mean": 0.18836148871750003,
"stddev": 0.0105974152891434,
"median": 0.18888381078000005,
"user": 0.19982849,
"system": 0.06966330999999999,
"min": 0.16972070578000004,
"max": 0.21015487078000003
},
{
"command": "pnpr@HEAD",
"mean": 0.08932166287375001,
"stddev": 0.002454789545131502,
"median": 0.08915102228,
"user": 0.03212283375000001,
"system": 0.013122245624999999,
"min": 0.08510255978,
"max": 0.09512703178000001
},
{
"command": "pnpr@main",
"mean": 0.08815399868909092,
"stddev": 0.0017942138668971847,
"median": 0.08792176578000001,
"user": 0.032143573333333335,
"system": 0.011342783636363634,
"min": 0.08458254478,
"max": 0.09286239678000001
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5715517844933333,
"stddev": 0.07518746947887314,
"median": 0.58634486616,
"user": 0.6050935066666666,
"system": 0.12771764444444444,
"min": 0.40867059116000004,
"max": 0.68594584916
},
{
"command": "pacquet@main",
"mean": 0.5724604919377778,
"stddev": 0.07124897537131682,
"median": 0.57408008016,
"user": 0.5938636177777777,
"system": 0.14377975555555553,
"min": 0.42809254916000006,
"max": 0.69383625516
},
{
"command": "pnpm@HEAD",
"mean": 2.902527197271111,
"stddev": 0.057868128983083245,
"median": 2.90333101816,
"user": 4.5604642844444445,
"system": 0.2328683111111111,
"min": 2.8033688691600003,
"max": 3.01858200016
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.40735455948,
"stddev": 0.1342688019686999,
"median": 4.38512393188,
"user": 1.3080205999999996,
"system": 1.4530751199999998,
"min": 4.26167742788,
"max": 4.685672053879999
},
{
"command": "pacquet@main",
"mean": 4.372537090579999,
"stddev": 0.10525462229278806,
"median": 4.33832111938,
"user": 1.3015086999999999,
"system": 1.4426825200000002,
"min": 4.28710675288,
"max": 4.6229253428799995
},
{
"command": "pnpr@HEAD",
"mean": 3.4602662237799997,
"stddev": 0.1319063425908635,
"median": 3.4248916848800004,
"user": 1.2369409999999998,
"system": 1.3440276199999999,
"min": 3.34669468488,
"max": 3.72465455688
},
{
"command": "pnpr@main",
"mean": 3.4335399763800005,
"stddev": 0.1049960882971798,
"median": 3.38516036738,
"user": 1.1918381999999998,
"system": 1.3649719200000001,
"min": 3.3393071838800004,
"max": 3.61489386588
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.10471369353999999,
"stddev": 0.00292936664329227,
"median": 0.10528010298,
"user": 0.1270688,
"system": 0.12007536,
"min": 0.09986591298,
"max": 0.11014063398
},
{
"command": "pacquet@main",
"mean": 0.10527949518,
"stddev": 0.004484262634693226,
"median": 0.10595551998,
"user": 0.13106104000000002,
"system": 0.12328984000000003,
"min": 0.09796050798,
"max": 0.11365360498
},
{
"command": "pnpr@HEAD",
"mean": 0.12124931593238097,
"stddev": 0.0025770830287099714,
"median": 0.12132149398,
"user": 0.13388526476190477,
"system": 0.12982782666666665,
"min": 0.11747824198000001,
"max": 0.12663536598000003
},
{
"command": "pnpr@main",
"mean": 0.11691629552545456,
"stddev": 0.0024002429127928993,
"median": 0.11725650048,
"user": 0.13511576909090908,
"system": 0.12474947818181818,
"min": 0.11195094998,
"max": 0.12214035998
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/14875 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| gvs-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 117.48 ms |
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,416.15 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 274.72 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 236.52 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 85.10 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,275.51 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,346.69 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 223.38 ms |
| isolated-linker.repeat-install.cold-cache.hot-store | 📈 view plot | 5.98 ms |
| isolated-linker.repeat-install.hot-cache.hot-store | 📈 view plot | 5.85 ms |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14875 +/- ##
==========================================
+ Coverage 90.81% 90.90% +0.09%
==========================================
Files 1252 1263 +11
Lines 161609 169369 +7760
==========================================
+ Hits 146759 153963 +7204
- Misses 14850 15406 +556 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Pin the formatter update that counts indentation and assignment prefixes when grouping leading fields and await. Keep the receiver in place when the access exceeds the limit, and preserve short prefixes. Apply the layout and extract helpers where wrapping exceeds existing size limits. Keep the overall line width at 100 columns.
|
Code review by qodo was updated up to the latest commit f8d8a11 |
PR Code Suggestions ✨Warning
|
|||||||||
Preserve Max heuristics and compact struct literals. Give complexity-based chain formatting a 40-column inline allowance and recognize simple method values and expression closures. Keep final fields and await attached up to 100 columns while intermediate leading accesses retain the 80-column limit, using the same rules in conditions. Pin the tested formatter revision and rebuild the source diff from the base, retaining only refactors needed for the existing size limits. Remove the config macro extension and place new helpers before tests.
|
Code review by qodo was updated up to the latest commit da63eb7 |
PR Code Suggestions ✨Warning
|
|||||||||
Pin the formatter update that keeps the first method with its receiver when the full first line ends at or before the continuation indentation. Count preceding bindings and keywords toward the allowance. Reformat the workspace and remove helper extractions that the resulting layout no longer needs to satisfy the existing size limits.
|
Code review by qodo was updated up to the latest commit 01d098d |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The two chains these tests build are past the limit the complexity-aware formatter adopted in pnpm#14875, which the stable `cargo fmt` in my environment cannot even parse a config for. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The two chains these tests build are past the limit the complexity-aware formatter adopted in pnpm#14875, which the stable `cargo fmt` in my environment cannot even parse a config for. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Pin pnpm's rustfmt fork and use a cached wrapper for local formatting, CI, pre-push checks, and editor integration. The formatter has its own dated nightly runtime while the workspace keeps its existing compiler. Choose chain layout by call count and argument complexity, with a 40-column allowance for short expressions. Attach the first method when the complete first line would otherwise end within the continuation indentation. Preserve simple receivers, cap intermediate leading accesses at column 80 and final accesses at 100, and separate fields and await after wrapped methods. Apply the same rules in conditions. Keep Max heuristics and compact struct literals, with an independent 35-column destructuring limit. Reformat pnpm and pnpr, extract only the helpers and test modules needed for existing size limits, and fix macro commas without relaxing lint rules. Related to pnpm#14562 and pnpm#14862.
Pin pnpm's rustfmt fork and use a cached wrapper for local formatting, CI, pre-push checks, and editor integration. The formatter has its own dated nightly runtime while the workspace keeps its existing compiler. Choose chain layout by call count and argument complexity, with a 40-column allowance for short expressions. Attach the first method when the complete first line would otherwise end within the continuation indentation. Preserve simple receivers, cap intermediate leading accesses at column 80 and final accesses at 100, and separate fields and await after wrapped methods. Apply the same rules in conditions. Keep Max heuristics and compact struct literals, with an independent 35-column destructuring limit. Reformat pnpm and pnpr, extract only the helpers and test modules needed for existing size limits, and fix macro commas without relaxing lint rules. Related to pnpm#14562 and pnpm#14862.
Summary
Use a pinned pnpm rustfmt fork to format chains by complexity, with a small allowance for short expressions. Local tasks, CI, pre-push checks, and documented editor commands use a wrapper that builds and caches the exact revision.
let entries =toward this allowance, including when rustfmt tries moving the right-hand side to a new line. This follows the Rust style guide’s rule for short first lines; only the first method can attach..awaitwith their receiver up to column 80, counting indentation and preceding code. Intermediate accesses that exceed that limit start new lines; a final access uses the normal 100-column limit. Fields or.awaitafter wrapped methods start new lines.?stays attached.use_small_heuristics = "Max"and compact struct literals. Give destructuring its own 35-column limit.Reformat pnpm and pnpr, fix macro commas, and make the bounded helper/test-module extractions needed to retain the existing size limits. Reuse existing modules where possible and keep new production helpers before test-module declarations. The config macro interface is unchanged. This is development tooling and behavior-preserving refactoring, so no user-facing changeset is needed.
Measured against base commit
9cd124f665,pnpm/Rust source grows from 575,231 to 598,265 lines (+4.0%, including tests). The final Rust diff adds 23 files across pnpm and pnpr.Related to #14562. This complements #14862, which addresses chain complexity linting; this PR controls formatting and integrates the formatter.
Validation:
just readypassed, including workspace compilation, 11,129 tests (13 configured skips), strict Clippy, formatting, and spelling checks. Strict workspace Dylint, documentation checks, TOML formatting, whitespace checks, and all seven wrapper tests passed. The fork’s full tests, formatting idempotence matrices, and stock-behavior comparisons passed.Squash Commit Body
Checklist
already linked to it solves it.
Written by an agent (Codex, GPT-6).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.