Format the code with rustfmt and check formatting and lints in CI

未關閉 適合新手
#12 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
88/100
Issue 類型
重構
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
github-actions, markdown, rust
領域
devtools

研究方向

先執行 cargo fmt --all 並單獨提交,然後檢查 cargo fmt --all --check 沒有任何輸出。接著編輯 .github/workflows/ci.yml,在 Test 之前新增 fmt 和 clippy 步驟,並在 dtolnay/rust-toolchain@stable 步驟中加入 components: rustfmt, clippy。最後在 CONTRIBUTING.md 中新增一行。當兩條 cargo 指令在本機和 CI 中都通過,且行為沒有改變時,即完成。

由索引模型根據 Issue 內容生成。

描述

enhancement good first issue

The Rust code isn't run through rustfmt yet, so contributors who format their changes get unrelated diffs in other files. cargo fmt --all --check currently reports differences in 14 files. cargo clippy --workspace --all-targets is already clean, but nothing keeps it that way.

This is a good first contribution: no Windows API knowledge needed.

What to do

  1. Run cargo fmt --all and commit the result on its own, with no other changes, so it is easy to review.

  2. In .github/workflows/ci.yml, add two steps before Test:

    • cargo fmt --all --check
    • cargo clippy --workspace --all-targets -- -D warnings

    dtolnay/rust-toolchain@stable needs components: rustfmt, clippy for these to work.

  3. Mention in CONTRIBUTING.md that contributors should run cargo fmt --all before opening a pull request.

Done when

  • cargo fmt --all --check and cargo clippy --workspace --all-targets -- -D warnings both pass locally and in CI.
  • No code behaviour changes.
主要語言
Rust
星號
7
分支
1
平均合併
6 小時 34 分鐘
30 天內合併 PR
2

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

CodingRule/Hidely 的其他 Issue

查看 CodingRule/Hidely 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。