Skip to content

Commit

Permalink
Consolidate clippy rules into workspace config
Browse files Browse the repository at this point in the history
  • Loading branch information
benbrandt committed May 2, 2024
1 parent cc4f73e commit 5b66e38
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 27 deletions.
32 changes: 18 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ license = "MIT"
keywords = ["text", "split", "tokenizer", "nlp", "ai"]
categories = ["text-processing"]


[workspace.lints.rust]
future_incompatible = { level = "warn", priority = -1 }
missing_debug_implementations = "warn"
missing_docs = "warn"
nonstandard_style = { level = "warn", priority = -1 }
rust_2018_compatibility = { level = "warn", priority = -1 }
rust_2018_idioms = { level = "warn", priority = -1 }
rust_2021_compatibility = { level = "warn", priority = -1 }
rust_2024_compatibility = { level = "warn", priority = -1 }
unused = { level = "warn", priority = -1 }

[workspace.lints.clippy]
cargo = "warn"
pedantic = "warn"

[package]
name = "text-splitter"
version.workspace = true
Expand Down Expand Up @@ -84,20 +100,8 @@ rust-tokenizers = ["dep:rust_tokenizers"]
tiktoken-rs = ["dep:tiktoken-rs"]
tokenizers = ["dep:tokenizers"]

[lints.rust]
future_incompatible = { level = "warn", priority = -1 }
missing_debug_implementations = "warn"
missing_docs = "warn"
nonstandard_style = { level = "warn", priority = -1 }
rust_2018_compatibility = { level = "warn", priority = -1 }
rust_2018_idioms = { level = "warn", priority = -1 }
rust_2021_compatibility = { level = "warn", priority = -1 }
rust_2024_compatibility = { level = "warn", priority = -1 }
unused = { level = "warn", priority = -1 }

[lints.clippy]
cargo = "warn"
pedantic = "warn"
[lints]
workspace = true

# Tokenizers and indirect deps can cause slow runtime
[profile.dev.package."*"]
Expand Down
3 changes: 3 additions & 0 deletions bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ tiktoken-rs = "0.5.8"
tokenizers = { version = "0.19.1", default_features = false, features = [
"onig",
] }

[lints]
workspace = true
15 changes: 2 additions & 13 deletions bindings/python/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
//! Python Bindings for text-splitter crate
#![warn(
clippy::pedantic,
future_incompatible,
missing_debug_implementations,
missing_docs,
nonstandard_style,
rust_2018_compatibility,
rust_2018_idioms,
rust_2021_compatibility,
unused
)]
// pyo3 uses this
#![allow(elided_lifetimes_in_paths)]
// pyo3 uses these
#![allow(elided_lifetimes_in_paths, unsafe_op_in_unsafe_fn)]

use std::str::FromStr;

Expand Down

0 comments on commit 5b66e38

Please sign in to comment.