配置: - rustfmt.toml: 固化 max_width=100 / 4 空格缩进,cargo fmt 全量格式化 - Cargo.toml: 配置 [lints.rust] 与 [lints.clippy] 渐进式规则 - .github/workflows/ci.yml: Rust(fmt+clippy+test) + 前端(eslint+tsc+test) 双平台 CI - Makefile: 新增 check/fmt/fix 目标,clippy 对齐 --all-targets --all-features - web: eslint flat config + prettier 配置 + package.json 脚本与依赖 - src/main.rs: loop→while 修复 clippy::never_loop 对抗性审查发现并修复: - eslint 缺 caughtErrorsIgnorePattern 导致 catch(_) 误报为 error - 前端 lint 未接入 CI,现已补上 Lint 步骤 - Makefile 与 CI 的 clippy flags 不一致,已对齐
13 lines
419 B
TOML
13 lines
419 B
TOML
# PicoBot Rust 代码格式化规则
|
||
#
|
||
# 设计原则:尽量贴近 rustfmt 默认风格,仅固化少数项目级偏好。
|
||
# 不追求激进重排,避免一次性产生大量 diff。
|
||
# 仅使用 stable rustfmt 支持的选项,不依赖 nightly 特性。
|
||
|
||
# 行宽:100,现代显示器友好
|
||
max_width = 100
|
||
|
||
# 缩进用 4 空格(Rust 社区主流,与现有代码一致)
|
||
hard_tabs = false
|
||
tab_spaces = 4
|