[package]
name = "diffctx"
version = "1.12.3"
edition = "2024"
rust-version = "1.85"
description = "Selects the minimum code an LLM needs to review a git diff: walks the dependency graph outward from changed lines and stops when extra context stops paying for itself"
license = "Apache-2.0"
repository = "https://github.com/nikolay-e/diffctx"
homepage = "https://github.com/nikolay-e/diffctx"
documentation = "https://docs.rs/diffctx"
readme = "../../README.md"
keywords = ["git", "diff", "llm", "context", "tree-sitter"]
categories = ["development-tools", "command-line-utilities"]
exclude = ["tests/**", "src/test_harness.rs"]
[lib]
name = "_diffctx"
crate-type = ["cdylib", "rlib"]
[[bin]]
name = "diffctx"
path = "src/main.rs"
[[example]]
name = "diffctx-test"
path = "src/test_harness.rs"
[features]
default = ["lang-core", "lang-extra"]
python = ["pyo3"]
lang-core = [
"tree-sitter-python",
"tree-sitter-javascript",
"tree-sitter-typescript",
"tree-sitter-go",
"tree-sitter-rust",
"tree-sitter-java",
"tree-sitter-c",
"tree-sitter-cpp",
"tree-sitter-c-sharp",
"tree-sitter-ruby",
"tree-sitter-php",
"tree-sitter-bash",
"tree-sitter-html",
"tree-sitter-css",
"tree-sitter-json",
"tree-sitter-yaml",
]
lang-extra = [
"tree-sitter-haskell",
"tree-sitter-julia",
"tree-sitter-ocaml",
"tree-sitter-r",
"tree-sitter-elixir",
"tree-sitter-lua",
"tree-sitter-zig",
"tree-sitter-erlang",
"tree-sitter-nix",
"tree-sitter-groovy",
"tree-sitter-objc",
"tree-sitter-cmake",
"tree-sitter-make",
"tree-sitter-hcl",
"tree-sitter-clojure",
"tree-sitter-graphql",
"tree-sitter-dart",
"tree-sitter-prisma-io",
"tree-sitter-svelte-ng",
"tree-sitter-scala",
"tree-sitter-swift",
]
[dependencies]
mimalloc = { version = "0.1", default-features = false }
clap = { version = "4", features = ["derive"] }
tree-sitter = "0.25"
tree-sitter-python = { version = "0.25", optional = true }
tree-sitter-javascript = { version = "0.25", optional = true }
tree-sitter-typescript = { version = "0.23", optional = true }
tree-sitter-go = { version = "0.25", optional = true }
tree-sitter-rust = { version = "0.24", optional = true }
tree-sitter-java = { version = "0.23", optional = true }
tree-sitter-c = { version = "0.24", optional = true }
tree-sitter-cpp = { version = "0.23", optional = true }
tree-sitter-c-sharp = { version = "0.23", optional = true }
tree-sitter-ruby = { version = "0.23", optional = true }
tree-sitter-php = { version = "0.24", optional = true }
tree-sitter-scala = { version = "0.26", optional = true }
tree-sitter-swift = { version = "0.7", optional = true }
tree-sitter-html = { version = "0.23", optional = true }
tree-sitter-bash = { version = "0.25", optional = true }
tree-sitter-css = { version = "0.25", optional = true }
tree-sitter-json = { version = "0.24", optional = true }
tree-sitter-haskell = { version = "0.23", optional = true }
tree-sitter-julia = { version = "0.23", optional = true }
tree-sitter-ocaml = { version = "0.25", optional = true }
tree-sitter-yaml = { version = "0.7", optional = true }
tree-sitter-r = { version = "1.2", optional = true }
tree-sitter-elixir = { version = "0.3", optional = true }
tree-sitter-lua = { version = "0.5", optional = true }
tree-sitter-zig = { version = "1.1", optional = true }
tree-sitter-erlang = { version = "0.19", optional = true }
tree-sitter-nix = { version = "0.3", optional = true }
tree-sitter-groovy = { version = "0.1", optional = true }
tree-sitter-objc = { version = "3.0", optional = true }
tree-sitter-cmake = { version = "0.7", optional = true }
tree-sitter-make = { version = "1.1", optional = true }
tree-sitter-hcl = { version = "1.1", optional = true }
tree-sitter-clojure = { version = "0.1", optional = true }
tree-sitter-graphql = { version = "0.1", optional = true }
tree-sitter-dart = { version = "0.2", optional = true }
tree-sitter-prisma-io = { version = "1.6", optional = true }
tree-sitter-svelte-ng = { version = "1.0", optional = true }
tiktoken-rs = "=0.12.0"
rayon = "1.10"
serde = { version = "1", features = ["derive", "rc"] }
serde_json = "1"
serde_yaml = "0.9"
thiserror = "2"
anyhow = "1"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
regex = "1"
once_cell = "1"
rustc-hash = "2"
similar = "3"
glob = "0.3"
walkdir = "2"
wait-timeout = "0.2"
libc = "0.2"
pyo3 = { version = "0.29", features = ["extension-module", "abi3-py310"], optional = true }
[dev-dependencies]
tempfile = "3"
libtest-mimic = "0.8"
[[test]]
name = "yaml_cases"
harness = false
[lints.clippy]
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }
module_name_repetitions = "allow"
must_use_candidate = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
redundant_closure_for_method_calls = "allow"
too_many_lines = "allow"
too_many_arguments = "allow"
cast_possible_truncation = "allow"
cast_sign_loss = "allow"
cast_precision_loss = "allow"
cast_lossless = "allow"
items_after_statements = "allow"
similar_names = "allow"
struct_excessive_bools = "allow"
non_std_lazy_statics = "allow"
implicit_hasher = "allow"
manual_let_else = "allow"
missing_const_for_fn = "allow"
option_if_let_else = "allow"
unnested_or_patterns = "allow"
unused_self = "allow"
cargo_common_metadata = "allow"
type_complexity = "allow"
should_implement_trait = "allow"
multiple_crate_versions = "allow"
single_match_else = "allow"
new_without_default = "allow"
[lints.rust]
unsafe_code = "deny"