Move patch/redirect/mod.rs's inline test modules into sibling test files
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 82/100
Rechercherichtung
Beginne in crates/socket-patch-core/src/patch/redirect/mod.rs: der Produktionscode endet bei L7622, mod tests läuft von L7623–L21402 plus fünf weitere #[cfg(test)]-Module bis L21936. Verschiebe jeden Modulkörper wörtlich in eine Schwesterdatei (redirect/tests.rs, python_lock_warning_tests.rs etc.), deklariere sie als #[cfg(test)] mod ...; in mod.rs, nutze use super::* für die Sichtbarkeit und nimm die vorhandenen *_equivalence_tests.rs-Dateien (L33–L49) als Muster. Fertig, wenn cargo test -p socket-patch-core redirect:: wie zuvor 307/322 Tests bestanden zeigt, cargo clippy -p socket-patch-core --all-targets sauber ist und git diff --color-moved=zebra nur verschobene Blöcke anzeigt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
[agent] Filed by the scheduled architecture audit routine (ecosystems and formats). Register: register comment.
Kind: refactor. Source: §3.7 #1 (step 1 of tracking #1010). Register E30.
Problem
About two thirds of patch/redirect/mod.rs (21,936 lines at db83f01) is inline tests:
mod tests, L7623–L21402: 13,780 lines and 307 tests (322 across all six modules), covering every ecosystem's rewriter;python_lock_warning_tests(L21403),python_metadata_pairing_tests(L21445),hatch_tests(L21546),hosted_patch_uuid_tests(L21665) andsuperseding_repin_tests(L21792–L21936).
The production code ends at L7622. The sibling *_equivalence_tests.rs files already use the sibling-file pattern (L35–L45).
Impact
- Each hosted test addition creates a conflict hotspot in the same file as the production code.
- Production review is buried in a 22K-line file.
- This is the cheapest step of the split, and it removes about 14.3K lines from
mod.rswithout touching a production line.
Proposed change
- Declare the modules from
mod.rsand move each one's body verbatim into its own file:#[cfg(test)] mod tests;→redirect/tests.rs, and likewisepython_lock_warning_tests.rs,python_metadata_pairing_tests.rs,hatch_tests.rs,hosted_patch_uuid_tests.rsandsuperseding_repin_tests.rs. - Inside each file,
use super::*keeps the same visibility, so no item changes visibility. - Optional, in a follow-up and not this PR: split
tests.rsper ecosystem once the production split (later steps of #1010) lands.
Deleted from mod.rs: L7623–L21936.
Size and scope
- Files:
redirect/mod.rsand six new sibling files. - About 14.3K moved lines, 0 changed production lines, and about 12 added declaration lines.
- Out of scope: any production move, any test edit or rename, and the equivalence suites.
Acceptance criteria
-
git diff --color-moved=zebrashows only moved blocks, plus the sixmoddeclarations. -
mod.rsis ≤ ~7.7K lines. -
cargo test -p socket-patch-core redirect::runs the same number of tests before and after (307 intestsand 322 across the six modules), and all of them pass. -
cargo clippy -p socket-patch-core --all-targetsis clean (no newunusedwarnings from the move).
Dependencies
None. It is best landed when few PRs touching redirect/mod.rs tests are open, because open PRs will need a trivial rebase onto the moved file. It is step 1 of #1010 and unblocks nothing technically, but it makes steps 2–7 reviewable.
- Vorherrschende Sprache
- Rust
- Sterne
- 8
- Forks
- 1
- Ø Merge
- 18 Std. 19 Min.
- Gemergte PRs (30 T.)
- 504
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus SocketDev/socket-patch
-
agent:triaged bug bughunt pm:npm priority:p3 ux
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
SocketDev/socket-patch#1072 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged bug bughunt pm:yarn-berry priority:p1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
SocketDev/socket-patch#783 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Vendored cargo warns cargo_multi_version_old_cargo ("declares no rust-version") when the root package inherits rust-version from [workspace.package]Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenagent:triaged bug bughunt pm:cargo priority:p2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
SocketDev/socket-patch#651 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug bughunt pm:npm
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
SocketDev/socket-patch#1481 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Hosted gem scan ignores a Gemfile `lockfile "custom.lock"` DSL call (Bundler 4), so it pins the unused Gemfile.lock, leaves the real lock untouched, and every frozen install failsEvtl. vergeben @mikolalysenko hat das heute übernommen. Offenagent:claimed agent:triaged bug bughunt pm:bundler priority:p1
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
SocketDev/socket-patch#1477 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in SocketDev/socket-patch
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
cmlarsen/writemorebetter#158 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
-
state:triage-needed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
scanaislop/aislop#482 ·
Maintainer antworten meist innerhalb von 1 Tag
-
docs(skills): issue-first should reference an existing Linear ticket instead of filing a duplicateOffendocumentation
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag