Code organization and style
@flying-sheep がすでに取り組んでいます。
2026年6月25日 から。
評価
この issue はまだ評価されていません。
説明
Great job @Psy-Fer!
Here’s my review of the code base and what I think we could do:
-
Code reuse prevents drift/partial fixes and improves maintainability: some
ifexpressions have almost the same code on both sides, some blocks are near-verbatim duplicates. We can use loops or helper functions to centralize some of that code. E.g. I added this: https://github.com/scverse/rustar-aligner/blob/199290d83904940a7316be7468b858bc8d39bd48/src/align/transcript.rs#L61-L65 and used it in a little helper I added for a pattern I saw infinalize_transcript: https://github.com/scverse/rustar-aligner/blob/199290d83904940a7316be7468b858bc8d39bd48/src/align/stitch.rs#L1756-L1764 -
Clear use of numeric types prevents overflow bugs like https://github.com/scverse/rustar-aligner/blob/199290d83904940a7316be7468b858bc8d39bd48/docs-old/dev/BUGFIX_2026-02-09.md#L21-L26
We currently use
u32,i32,u64,i64, andusizewith no clear guidence of why we use what where. Would be amazing if we could eventually enable all the clippy lints for unsafe casts after cleaning all that up, e.g. changingif some_i32 > 0 { thing = some_i32 as u32 }tothing = u32::try_from(some_i32)...or so -
Rust has a lot of ways to abstract things (e.g. the extension traits from the first point), and I thing we should use them, e.g. code like this encapsulating a single task should be part of a function or trait instead of just appearing in the business logic: https://github.com/scverse/rustar-aligner/blob/199290d83904940a7316be7468b858bc8d39bd48/src/align/read_align.rs#L353-L366
Maybe using
itertoolscould help in some cases? IDK if e.g. using its hash-baseduniqhere would be more efficient or less than our very ad-hoc lookingsort-then-dedup. -
I personally really like splitting up huge multi-step functions like the above-mentioned
finalize_transcriptinto individual steps that are clear in what they receive and what they emit. Every function that has// 1. do first step: …could instead call another function for this step. custom structs can help holding common context for this.
- 主要言語
- Rust
- スター
- 76
- フォーク
- 7
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
scverse/rustar-aligner のほかの issue
-
BufferedSamRecords::new() reserves 10,000 records per read対応中かも @BenjaminDEMAILLE が 7 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
scverse/rustar-aligner#280 ·
-
solo: --soloBarcodeMate does not require clipping the barcode off the mate, so the barcode bases stay in the aligned read対応中かも @BenjaminDEMAILLE が 41 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
scverse/rustar-aligner#227 ·
-
Single-end --chimOutType WithinBAM fails with "read length-sequence length mismatch"対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
scverse/rustar-aligner#279 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
scverse/rustar-aligner#277 ·
-
Consider hdf5-pure (pure-Rust HDF5) for optional .h5 output対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンdependencies file-formats
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
scverse/rustar-aligner#270 ·
scverse/rustar-aligner の issue をすべて見る
似ている issue
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
fastrevmd-lab/rustmistmcp#161 ·
-
arch-audit refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
SocketDev/socket-patch#1011 ·
メンテナーはふだん 1 日以内に返信
-
bug user-priority/P2
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
opencode: an unanswered --version probe launches opencode 2 without per-session service isolationオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
security-advisory
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
MinBZK/regelrecht#1686 ·
メンテナーはふだん 1 日以内に返信