[package]
name = "mkdlint"
version = "0.11.0"
edition = "2024"
license = "Apache-2.0"
description = "A style checker and lint tool for Markdown/CommonMark files, written in Rust."
repository = "https://github.com/192d-Wing/mkdlint"
readme = "README.md"
keywords = ["markdown", "lint", "commonmark", "linter", "checker"]
categories = ["command-line-utilities", "development-tools", "text-processing"]
rust-version = "1.93"

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

[[bin]]
name = "mkdlint"
path = "src/main.rs"
required-features = ["cli"]

[[bin]]
name = "mkdlint-lsp"
path = "src/bin/mkdlint-lsp.rs"
required-features = ["lsp"]

[dependencies]
# Markdown parsing
comrak = { version = "0.50", default-features = false, features = ["syntect"] }

# Async runtime (optional, for async API)
tokio = { version = "1.41", features = [
    "rt-multi-thread",
    "fs",
    "io-util",
    "sync",
    "time", "io-std", "macros",
], optional = true }

# Parallel processing
rayon = "1.10"

# Serialization and configuration
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml_ng = "0.10"
toml = "1.0"

# Error handling
anyhow = "1.0"
thiserror = "2.0"

# Utilities
regex = "1.11"
once_cell = "1.20"
unicode-width = "0.2"
dashmap = "6.1"

# CLI dependencies (optional)
clap = { version = "4.5", features = ["derive", "cargo"], optional = true }
colored = { version = "3.1", optional = true }
walkdir = { version = "2.5", optional = true }
globset = { version = "0.4", optional = true }
dialoguer = { version = "0.11", optional = true }
notify = { version = "6.1", optional = true }
notify-debouncer-full = { version = "0.3", optional = true }

# LSP dependencies (optional)
tower-lsp = { version = "0.20", optional = true }
lsp-types = { version = "0.94", optional = true }
tower = { version = "0.5", optional = true }
url = { version = "2.5", optional = true }
env_logger = { version = "0.11", optional = true }

[dev-dependencies]
tokio = { version = "1.41", features = ["rt", "macros", "fs"] }
criterion = "0.8"
proptest = "1.5"
tempfile = "3.14"
pretty_assertions = "1.4"
insta = "1.41"                                                  # Snapshot testing

[features]
default = ["cli"]
cli = ["dep:clap", "dep:colored", "dep:walkdir", "dep:globset", "dep:dialoguer", "dep:notify", "dep:notify-debouncer-full"]
async = ["dep:tokio"]
lsp = ["async", "dep:tower-lsp", "dep:lsp-types", "dep:tower", "dep:url", "dep:env_logger"]

[[bench]]
name = "lint_bench"
harness = false

[profile.release]
opt-level = 3
lto = true
codegen-units = 1
strip = true

[profile.bench]
inherits = "release"

# Faster builds for development
[profile.dev.package."*"]
opt-level = 2
