Move patch/redirect/mod.rs's inline test modules into sibling test files
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 82/100
Direção de pesquisa
Comece em crates/socket-patch-core/src/patch/redirect/mod.rs: o código de produção termina em L7622, mod tests vai de L7623 a L21402 mais cinco outros módulos #[cfg(test)] até L21936. Mova o corpo de cada módulo verbatim para um arquivo irmão (redirect/tests.rs, python_lock_warning_tests.rs, etc.), declarando-os como #[cfg(test)] mod ...; a partir de mod.rs, usando use super::* para visibilidade e os arquivos *_equivalence_tests.rs existentes (L33–L49) como padrão. Concluído quando cargo test -p socket-patch-core redirect:: mostrar 307/322 testes aprovados como antes, cargo clippy -p socket-patch-core --all-targets estiver limpo e git diff --color-moved=zebra mostrar apenas blocos movidos.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
[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.
- Linguagem predominante
- Rust
- Estrelas
- 8
- Forks
- 0
- Merge médio
- 1d 1h
- PRs com merge (30d)
- 211
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de SocketDev/socket-patch
-
agent:triaged arch-audit bug priority:p3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
SocketDev/socket-patch#982 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Hosted yarn classic pins give no berry-migration warning, so a yarn 2+ install silently drops them (vendored warns about the same trap)Talvez já em andamento @mikolalysenko assumiu há 1 dia. Abertaagent:claimed agent:triaged bug bughunt pm:yarn-classic priority:p1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
SocketDev/socket-patch#907 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
agent:triaged bug bughunt pm:bundler priority:p1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
SocketDev/socket-patch#896 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
agent:triaged bug bughunt pm:yarn-berry priority:p1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
SocketDev/socket-patch#783 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
agent:triaged bug bughunt pm:pipenv priority:p1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
SocketDev/socket-patch#744 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de SocketDev/socket-patch
Issues semelhantes
-
documentation
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
fastrevmd-lab/rustmistmcp#161 ·
-
bug user-priority/P2
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
Mantenedores costumam responder em até 1 dia
-
opencode: an unanswered --version probe launches opencode 2 without per-session service isolationAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
-
security-advisory
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
MinBZK/regelrecht#1686 ·
Mantenedores costumam responder em até 1 dia
-
L: github:actions L: php:composer
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
dependabot/dependabot-core#16493 ·
Mantenedores costumam responder em até 1 dia