Skip to content

Commit b62980b

Browse files
committed
fix(audit): --diff flag, anyio dep, README example, unused_mut warn
1 parent baba4a0 commit b62980b

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,16 @@ text_str = to_text(tree)
179179
md_str = to_markdown(tree)
180180
181181
# Diff context mode
182-
from treemapper import build_diff_context
182+
from pathlib import Path
183+
from treemapper import build_diff_context, to_yaml
183184
184185
ctx = build_diff_context(
185-
root_dir, # Path to repository root
186-
diff_range, # e.g. "HEAD~1..HEAD", "main..feature"
187-
budget_tokens=None, # token limit (None = convergence-based)
186+
Path("."), # repository root
187+
"HEAD~1..HEAD", # diff range; also accepts "main..feature"
188+
budget_tokens=None, # None = convergence-based (default)
189+
# 0 = diff only, no expansion (recall floor)
190+
# <0 = unlimited (10M-token soft ceiling)
191+
# >0 = explicit token cap
188192
alpha=0.6, # PPR damping factor
189193
tau=0.08, # stopping threshold
190194
full=False, # skip smart selection

diffctx/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct Cli {
2323
#[arg(long, default_value = "yaml")]
2424
format: String,
2525

26-
#[arg(long)]
26+
#[arg(long = "diff")]
2727
diff_ref: Option<String>,
2828

2929
#[arg(long, default_value_t = DEFAULT_PPR_ALPHA)]

diffctx/src/parsers/tree_sitter_strategy.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,7 @@ fn find_lang_config(path: &str) -> Option<&'static LangConfig> {
977977
}
978978

979979
static LANGUAGE_CACHE: Lazy<FxHashMap<&'static str, Language>> = Lazy::new(|| {
980+
#[allow(unused_mut)]
980981
let mut m: FxHashMap<&'static str, Language> = FxHashMap::default();
981982

982983
#[cfg(feature = "tree-sitter-python")]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ optional-dependencies.full = [
102102
"treemapper[tree-sitter]",
103103
]
104104
optional-dependencies.mcp = [
105+
"anyio>=4.5,<5.0",
105106
"mcp>=1.27,<2.0",
106107
]
107108
optional-dependencies.nlp = [

0 commit comments

Comments
 (0)