git-alias 1.2.24

A fast git alias tool with dual-style command support
# =============================================================================
# Rust 格式化配置 - FreeAgent-OS 项目规范
# =============================================================================
# 使用说明:
#   - cargo fmt          # 格式化代码
#   - cargo fmt --check  # 检查格式(CI 用)
# =============================================================================

# Rust 版本(必须指定)
edition = "2021"

# -----------------------------------------------------------------------------
# 缩进与空格
# -----------------------------------------------------------------------------
# 使用空格而非 Tab
hard_tabs = false
# 缩进宽度
tab_spaces = 4

# -----------------------------------------------------------------------------
# 行宽与换行
# -----------------------------------------------------------------------------
# 最大行宽(100 是默认友好值,120 适合宽屏,80 适合分屏)
max_width = 100
# 换行符风格:Unix(LF)跨平台推荐,Windows 用 Native
newline_style = "Unix"

# -----------------------------------------------------------------------------
# 导入语句
# -----------------------------------------------------------------------------
# 自动排序 use 语句
reorder_imports = true
# 自动排序模块声明
reorder_modules = true
# 不重新排序 impl 块中的项(避免与 rust-analyzer 冲突)
reorder_impl_items = false

# -----------------------------------------------------------------------------
# Derive 宏与结构体
# -----------------------------------------------------------------------------
# 不合并 derive 宏到单行(便于 git diff 查看改动)
merge_derives = false
# 使用小启发式规则:Max 尽量压缩短结构体/枚举到单行
use_small_heuristics = "Max"

# -----------------------------------------------------------------------------
# 注释与文档
# -----------------------------------------------------------------------------
# 格式化文档注释中的代码块
format_code_in_doc_comments = true
# 自动换行注释
wrap_comments = true
# 注释最大宽度
comment_width = 100

# -----------------------------------------------------------------------------
# 语法糖
# -----------------------------------------------------------------------------
# 字段初始化简写:User { name: name } → User { name }
use_field_init_shorthand = true
# try 简写:x.try_into().unwrap() → x.try_into()?
use_try_shorthand = true
# 移除嵌套括号:(a + b) → a + b
remove_nested_parens = true
# match 分支末尾加逗号
match_block_trailing_comma = true

# -----------------------------------------------------------------------------
# 排除目录(不格式化)
# -----------------------------------------------------------------------------
ignore = [
    "vendor",   # 第三方依赖
    "tests",    # 测试文件(避免与测试断言冲突)
    "docs",     # 文档目录(避免与文档生成冲突)
    "generated", # 生成的手动修改冲突)
]