diff&cmp not suitable to be called as library functions.
まだ誰も着手していません。
評価
調査の方向性
まず diff.rs と cmp.rs を確認し、次にトップレベルの main 関数とリンクされた修正コミットを調べて、現在の ExitCode と exit() の動作を確認します。テストがどのように構成されているかを確認し、プロセスを終了させずにエラーを返すケースのカバレッジを追加します。完了の条件は、両方のコマンドが引き続きビルド可能で、ライブラリの呼び出し元が適切な i32 の結果を受け取り、プロセスの終了を処理するのがトップレベルの main 関数だけであることです。
索引モデルが issue の本文から書いたものです。
説明
Problems with using diffutils.rs as a library:
- ExitCode is intended to be consumed only by the standard library ... For forwards compatibility with potentially unusual targets, this type currently does not provide Eq, Hash, or access to the raw value. ... so it seems library callers (such as myself) would prefer an i32.
- The exit(2) is worrying for library callers who don't want to be suddenly killed.
I got the hy3 model to create a fix for this for me. But it lumped it all into one big commit: https://github.com/gmatht/diffutils/commit/4bdd5219adf1485aaf60114ba10adf7e3a26ac7e
Should I make a pull request including two commits:
- Replace the ExitCode/exit() convention with i32 returns, everywhere except at the very top main function.
- Add Tests that ensure errors return an appropriate i32 instead of aborting the whole process.
Also should 1./2. be split into updating diff.rs and updating cmp.rs, resulting in 4 commits? If so, main should also should still be updated in each commit so e.g. it doesn't break the build.
Do you prefer that the test or the fix be commited first?
- 主要言語
- Rust
- スター
- 276
- フォーク
- 39
- 平均マージ
- 3時間 27分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
uutils/diffutils のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
uutils/diffutils の issue をすべて見る
似ている issue
-
risk:low runtime status:in-progress type:test
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
EricSpencer00/Resilient#4835 · コメント 1 件 ·
-
agent:ready documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
cesarferreira/stax#890 ·
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100