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 摘要。