[package]
name = "ddns-a"
version = "0.1.1"
edition = "2024"
rust-version = "1.85"
authors = ["doraemonkeys"]
description = "A lightweight Dynamic DNS client for Windows that monitors IP address changes and notifies external services via webhooks"
license = "Apache-2.0"
repository = "https://github.com/doraemonkeys/ddns-a"
homepage = "https://github.com/doraemonkeys/ddns-a"
readme = "README.md"
keywords = ["ddns", "dns", "webhook", "network", "windows"]
categories = ["command-line-utilities", "network-programming"]
exclude = [
    "docs/",
    "script/",
    "coverage_output/",
    "target/",
    "tarpaulin.toml",
    ".github/",
    ".gitignore",
]

[lib]
name = "ddns_a"
path = "src/lib.rs"

[[bin]]
name = "ddns-a"
path = "src/main.rs"

[dependencies]
# Async runtime
tokio = { version = "1", features = [
    "rt-multi-thread",
    "macros",
    "time",
    "sync",
    "signal",
    "test-util",
] }
tokio-stream = "0.1"

# HTTP types (decoupled from specific HTTP library)
http = "1"
url = "2"

# HTTP client implementation (v0.13 uses rustls by default)
reqwest = { version = "0.13", features = ["json"] }

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

# Configuration parsing
serde = { version = "1", features = ["derive"] }
serde_json = "1"
toml = "0.9"

# Structured logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

# Error handling
thiserror = "2"

# Name filtering (regex patterns)
regex = "1"

# Home directory resolution (tilde expansion)
dirs = "6"

# Template rendering (optional feature)
handlebars = "6"

# Windows API (platform-specific)
[target.'cfg(windows)'.dependencies]
windows = { version = "0.62", features = [
    "Win32_NetworkManagement_IpHelper",
    "Win32_NetworkManagement_Ndis",
    "Win32_Networking_WinSock",
    "Win32_Foundation",
] }

[dev-dependencies]
tempfile = "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"
