[package]
name = "sloc-guard"
version = "0.2.3"
edition = "2024"
repository = "https://github.com/doraemonkeys/sloc-guard"
homepage = "https://github.com/doraemonkeys/sloc-guard"
license = "Apache-2.0"
readme = "README.md"
keywords = ["sloc", "code-quality", "linter", "static-analysis", "complexity"]
categories = ["command-line-utilities", "development-tools"]
description = "A CLI tool that enforces SLOC limits and directory structure rules to guard against codebase complexity"

[dependencies]
# CLI parsing
clap = { version = "4", features = ["derive"] }

# Serialization/Deserialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"
toml = "0.9.8"

# File system
walkdir = "2"
globset = "0.4"
ignore = "0.4"
dunce = "1"

# Parallel processing
rayon = "1.10"

# Progress bar
indicatif = "0.18.3"

gix = { version = "0.76", default-features = false, features = [
    "revision",
    "index",
    "dirwalk",
] }

# Error handling
thiserror = "2"

# Cryptography
sha2 = "0.10"

# Regex for function parsing
regex = "1"

# HTTP client for remote config
reqwest = { version = "0.12", default-features = false, features = [
    "blocking",
    "rustls-tls",
] }

[dev-dependencies]
# Testing utilities
tempfile = "3"
assert_cmd = "2"
predicates = "3"


[lints.rust]
# Allow tarpaulin cfg for coverage exclusion
unexpected_cfgs = { level = "warn", check-cfg = [
    "cfg(tarpaulin_include)",
    "cfg(tarpaulin)",
] }

[lints.clippy]
# 基础配置
all = "deny" # 拒绝默认规则（把默认警告变成错误）
# 开启严格模式
pedantic = { level = "warn", priority = -1 } # 对 pedantic 规则发出警告
nursery = { level = "warn", priority = -1 }  # 对 nursery 规则发出警告
# 开启认知复杂度检查，并设为 Deny (报错) 或 Warn (警告)
cognitive_complexity = "deny"
too_many_lines = "deny"
