[package]
edition = "2024"
rust-version = "1.93.0"
name = "ptuf"
version = "0.5.0"
build = false
include = [
"src/**/*",
"Cargo.toml",
"Cargo.lock",
"README.md",
"LICENSE",
"CHANGELOG.md",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "PreToolUseFilter: a generic guardrail layer for coding agents"
homepage = "https://github.com/watany-dev/ptuf"
readme = "README.md"
keywords = [
"claude-code",
"guardrail",
"hook",
"pretooluse",
"agent",
]
categories = [
"command-line-utilities",
"development-tools",
]
license = "Apache-2.0"
repository = "https://github.com/watany-dev/ptuf"
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }{ archive-suffix }"
pkg-fmt = "tgz"
bin-dir = "{ name }-{ target }/{ bin }{ binary-ext }"
[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-fmt = "zip"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"--cfg",
"docsrs",
]
[features]
default = []
testing = ["dep:proptest"]
[lib]
name = "ptuf"
path = "src/lib.rs"
[[bin]]
name = "ptuf"
path = "src/main.rs"
[dependencies.proptest]
version = "1"
features = [
"std",
"bit-set",
]
optional = true
default-features = false
[dependencies.regex]
version = "1"
features = [
"std",
"perf",
"unicode-perl",
]
default-features = false
[dependencies.serde]
version = "1"
features = ["derive"]
[dependencies.serde_json]
version = "1"
[dependencies.serde_yaml_ng]
version = "0.10"
[dependencies.time]
version = "0.3"
features = [
"formatting",
"parsing",
]
[dependencies.toml_edit]
version = "0.25"
[dev-dependencies.divan]
version = "0.1"
[dev-dependencies.proptest]
version = "1"
features = [
"std",
"bit-set",
]
default-features = false
[dev-dependencies.tempfile]
version = "3"
[lints.clippy]
as_conversions = "allow"
assertions_on_result_states = "deny"
bool_to_int_with_if = "allow"
cast_lossless = "allow"
cast_possible_truncation = "allow"
cast_possible_wrap = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
clone_on_ref_ptr = "allow"
dbg_macro = "deny"
default_trait_access = "allow"
doc_markdown = "allow"
empty_drop = "deny"
empty_structs_with_brackets = "deny"
exit = "deny"
expect_used = "deny"
format_push_string = "allow"
implicit_clone = "allow"
indexing_slicing = "allow"
lossy_float_literal = "deny"
manual_let_else = "allow"
map_unwrap_or = "allow"
match_same_arms = "allow"
match_wildcard_for_single_variants = "allow"
mem_forget = "deny"
missing_const_for_fn = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
multiple_crate_versions = "allow"
multiple_inherent_impl = "allow"
must_use_candidate = "allow"
needless_collect = "allow"
needless_continue = "allow"
needless_pass_by_value = "allow"
needless_raw_string_hashes = "allow"
option_if_let_else = "allow"
option_option = "allow"
panic = "deny"
partial_pub_fields = "deny"
print_stderr = "deny"
print_stdout = "deny"
pub_without_shorthand = "deny"
rc_buffer = "deny"
redundant_clone = "allow"
redundant_closure_for_method_calls = "allow"
redundant_type_annotations = "deny"
return_self_not_must_use = "allow"
same_name_method = "deny"
self_named_module_files = "deny"
semicolon_if_nothing_returned = "allow"
semicolon_inside_block = "deny"
shadow_unrelated = "allow"
stable_sort_primitive = "allow"
struct_excessive_bools = "allow"
tests_outside_test_module = "allow"
todo = "deny"
too_long_first_doc_paragraph = "allow"
too_many_lines = "allow"
trivially_copy_pass_by_ref = "allow"
try_err = "deny"
unimplemented = "deny"
unnecessary_literal_bound = "allow"
unnecessary_safety_comment = "deny"
unnecessary_safety_doc = "deny"
unnecessary_self_imports = "deny"
unnecessary_wraps = "allow"
unneeded_field_pattern = "deny"
unreachable = "deny"
unwrap_used = "deny"
use_self = "allow"
used_underscore_binding = "allow"
useless_let_if_seq = "allow"
verbose_file_reads = "deny"
[lints.clippy.cargo]
level = "warn"
priority = -1
[lints.clippy.nursery]
level = "warn"
priority = -1
[lints.clippy.pedantic]
level = "warn"
priority = -1
[lints.rust]
meta_variable_misuse = "warn"
non_ascii_idents = "deny"
noop_method_call = "warn"
trivial_numeric_casts = "warn"
unsafe_code = "forbid"
unused_extern_crates = "warn"
unused_import_braces = "warn"
unused_must_use = "deny"
variant_size_differences = "warn"
[profile.dev]
opt-level = 0
panic = "unwind"
[profile.dev.package."*"]
opt-level = 1
[profile.dist]
lto = "fat"
codegen-units = 1
inherits = "release"
[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 1
debug = 0
panic = "abort"
strip = "symbols"