Cargo.toml
[package]
# The package and the command share one name, so that `uvx xpd` runs it.
name = "xpd"
version = "0.64.1"
edition = "2024"
rust-version = "1.99"
description = "Fast, opinionated linter for Python library habits with pandas, NumPy, SciPy, scikit-learn and eight more libraries, for humans and coding agents"
license = "MIT AND Apache-2.0 AND BSD-3-Clause AND NCSA AND MPL-2.0 AND ISC AND MIT-0 AND PSF-2.0"
repository = "https://github.com/bjoernaagaard/xpd"
homepage = "https://bjoernaagaard.github.io/xpd/"
readme = "README.md"
keywords = ["pandas", "python", "linter", "ast-grep", "agents"]
categories = ["command-line-utilities", "development-tools"]
# Only what the build needs; samples/ and the dev tool configs stay out of the package.
include = ["/src", "/.cargo/config.toml", "/indexes", "/licenses", "/python/**/*.py", "/rules", "/py", "/build.rs", "/skills", "/.claude-plugin/plugin.json", "/mcp.json", "/LICENSE-*", "/README.md", "/pyproject.toml"]
[[bin]]
name = "xpd"
path = "src/main.rs"
[dependencies]
anyhow = "1.0.104"
ast-grep = "0.51.3"
ast-grep-config = "0.51.3"
ast-grep-core = "0.51.3"
ast-grep-language = "0.51.3"
ast-grep-outline = "0.51.3"
clap = { version = "4.6.7", features = ["derive"] }
clap_complete = "4.6.3"
# ast-grep-config already builds globset, so this adds no package to the build.
globset = "0.4.21"
ignore = "0.4.34"
inquire = "0.9.5"
libcst = { version = "1.9.0", default-features = false }
llama-cpp-2 = { version = "0.1.161", default-features = false }
# `xpd lsp`. lsp-server is the synchronous scaffold of rust-analyzer: its messages travel over
# channels and need no async runtime. xpd reads and writes them on its own two threads, in
# src/lsp/transport.rs. lsp-types holds the protocol's types.
lsp-server = "0.10.0"
lsp-types = "0.97.0"
rayon = "1.12.0"
regex = "1.13.1"
# ast-grep-config already builds serde with derive, so this adds no package to the build.
serde = { version = "1.0.229", features = ["derive"] }
serde-saphyr = "2.1.1"
serde_json = "1.0.154"
similar = "3.2.1"
toml_edit = { version = "0.25.19", default-features = false, features = ["parse", "display"] }
shlex = "1.3"
sha2 = "0.10.9"
siphasher = "1.0.4"
gix = { version = "0.91.0", default-features = false, features = ["revision", "blob-diff", "sha1", "sha256"], optional = true }
salsa = { version = "0.28.6", optional = true }
duroxide = { version = "=0.2.1", features = ["sqlite"] }
tokio = { version = "1.54.1", features = ["rt", "macros", "process"] }
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
uuid = { version = "1.29.3", features = ["v4"] }
duroxide-pg = { version = "=0.2.0", optional = true }
[target.'cfg(target_os = "linux")'.dependencies]
openssl = { version = "0.10", features = ["vendored"] }
openssl-sys = { version = "0.9", features = ["vendored"] }
[target.'cfg(target_os = "linux")'.build-dependencies]
openssl-sys = { version = "0.9", features = ["vendored"] }
[features]
default = []
ledger-incremental = ["dep:gix", "dep:salsa"]
ledger-durable = ["ledger-incremental"]
ledger-distributed = ["ledger-durable", "dep:duroxide-pg"]
[build-dependencies]
anyhow = "1.0.104"
ast-grep-config = "0.51.3"
serde_json = "1.0.154"
[lints.rust]
unsafe_op_in_unsafe_fn = "warn" # each unsafe op needs its own unsafe block
missing_debug_implementations = "warn" # every public type implements Debug
unreachable_pub = "warn" # pub items that aren't actually exported
rust_2018_idioms = { level = "warn", priority = -1 } # 2018-edition idioms, e.g. Formatter<'_>
[lints.clippy]
# Groups first, at lower priority so the individual settings below win.
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
# Panics: return errors, and give every intentional panic a reason.
unwrap_used = "warn" # use ?, or expect("why this cannot fail")
expect_used = "allow" # expect with a reason is the sanctioned form
panic_in_result_fn = "warn" # a fn returning Result shouldn't also panic
missing_assert_message = "warn" # assert! says what went wrong (quiet inside #[test])
# Suppressions must explain themselves and expire when no longer needed.
allow_attributes = "warn" # prefer #[expect] over #[allow] (needs rust-version 1.81+)
allow_attributes_without_reason = "warn" # every suppression says why (needs rust-version 1.81+)
# Unsafe must be justified.
undocumented_unsafe_blocks = "warn" # // SAFETY: comment on every unsafe block
multiple_unsafe_ops_per_block = "warn" # one unsafe operation per block
# API shape.
fn_params_excessive_bools = "warn" # bool parameters: use an enum or two methods
struct_excessive_bools = "warn" # many bool fields: use an enum or bitflags
clone_on_ref_ptr = "warn" # write Rc::clone(&x) so cheap clones are visible
redundant_clone = "warn" # a clone whose original is never used again
rc_buffer = "warn" # Rc<String> / Rc<Vec<T>>: use Rc<str> / Rc<[T]>
# Idioms.
string_add = "warn" # build strings with format! or push_str, not +
wildcard_imports = "warn" # no glob imports (use super::* in tests is allowed)
# Output and debugging leftovers.
dbg_macro = "warn"
todo = "warn"
# Casts that silently lose information.
as_conversions = "warn" # prefer From / TryFrom
cast_possible_truncation = "warn"
cast_sign_loss = "warn"
# Pedantic lints that are mostly noise in practice, or that the skill disagrees with.
module_name_repetitions = "allow"
must_use_candidate = "allow"
module_inception = "allow" # a leaf module named after its main item is fine
enum_glob_use = "allow" # use Enum::* inside a function that matches on it
# Whole-program optimisation, for a smaller binary and faster startup on the hook's hot path.
[profile.release]
opt-level = "s"
lto = "thin"
codegen-units = 16
strip = true
[profile.dev.package."*"]
opt-level = 2