Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/tpcds-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ jobs:

- name: Cargo clippy
run: |
# First eliminate unwrap; then enable -D warnings to enforce all default lints.
cargo clippy --all-targets --workspace -- -A warnings -A clippy::all -D clippy::unwrap_used
cargo clippy --all-targets --workspace -- -D warnings

- name: Cargo test
run: |
Expand Down
85 changes: 85 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,95 @@ members = [
"native-engine/auron-memmgr",
]

[workspace.lints.rust]
# Pending processing (temporarily allow)
unused_variables = "allow"
dead_code = "allow"
unused_imports = "allow"
unused_must_use = "allow"
deprecated = "allow"

[workspace.lints.clippy]
unwrap_used = "deny"
panic = "deny"

# Pending processing (temporarily allow)
# Unwrap/Error Handling
unnecessary_unwrap = "allow"
needless_question_mark = "allow"
unnecessary_literal_unwrap = "allow"
bind_instead_of_map = "allow"
expect_fun_call = "allow"
io_other_error = "allow"
unnecessary_fallible_conversions = "allow"

# Unsafe/Memory
missing_transmute_annotations = "allow"
declare_interior_mutable_const = "allow"
borrow_interior_mutable_const = "allow"
uninit_vec = "allow"
macro_metavars_in_unsafe = "allow"
ptr_arg = "allow"
borrowed_box = "allow"

# Iterator/Collection
manual_flatten = "allow"
iter_cloned_collect = "allow"
into_iter_on_ref = "allow"
box_collection = "allow"
useless_vec = "allow"
len_without_is_empty = "allow"
len_zero = "allow"
mem_replace_option_with_none = "allow"
get_first = "allow"

# Loop/Control Flow
needless_range_loop = "allow"
while_let_loop = "allow"
while_let_on_iterator = "allow"
explicit_counter_loop = "allow"

# Format/String
useless_format = "allow"
uninlined_format_args = "allow"
to_string_in_format_args = "allow"

# Code Style/Redundancy (Part 1)
needless_borrow = "allow"
needless_return = "allow"
redundant_closure = "allow"
redundant_locals = "allow"
redundant_pattern_matching = "allow"

# Code Style/Redundancy (Part 2)
unnecessary_cast = "allow"
unnecessary_to_owned = "allow"
useless_asref = "allow"
clone_on_copy = "allow"
unit_arg = "allow"
manual_repeat_n = "allow"
manual_div_ceil = "allow"

# Condition/Logic
collapsible_if = "allow"
collapsible_else_if = "allow"
if_same_then_else = "allow"
match_like_matches_macro = "allow"
explicit_auto_deref = "allow"
bool_assert_comparison = "allow"

# Naming/Structure/Remaining
upper_case_acronyms = "allow"
module_inception = "allow"
too_many_arguments = "allow"
should_implement_trait = "allow"
extra_unused_lifetimes = "allow"
crate_in_macro_def = "allow"
int_plus_one = "allow"
derived_hash_with_manual_eq = "allow"
approx_constant = "allow"
op_ref = "allow"

[profile.release]
opt-level = 3
lto = true
Expand Down
3 changes: 1 addition & 2 deletions dev/mvn-build-helper/build-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ if [ ! -f "$cache_libpath" ] || [ "$new_checksum" != "$old_checksum" ]; then
cargo fmt --all -q -- 2>&1

echo "Running cargo clippy..."
# First eliminate unwrap; then enable -D warnings to enforce all default lints.
cargo clippy --all-targets --workspace -- -A warnings -A clippy::all -D clippy::unwrap_used 2>&1
cargo clippy --all-targets --workspace -- -D warnings 2>&1

echo "Building native with [$profile] profile..."
cargo build --profile="$profile" $features_arg --verbose --locked --frozen 2>&1
Expand Down
3 changes: 3 additions & 0 deletions native-engine/auron-jni-bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ version = "0.1.0"
edition = "2024"
resolver = "1"

[lints]
workspace = true

[dependencies]
datafusion = { workspace = true }
jni = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions native-engine/auron-memmgr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ name = "auron-memmgr"
version = "0.1.0"
edition = "2024"

[lints]
workspace = true

[dependencies]
auron-jni-bridge = { workspace = true }
datafusion = { workspace = true }
Expand Down
7 changes: 2 additions & 5 deletions native-engine/auron-memmgr/src/spill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn spill_compression_codec() -> &'static str {
if is_jni_bridge_inited() {
conf::SPILL_COMPRESSION_CODEC.value()
} else {
Ok(format!("lz4")) // for testing
Ok("lz4".to_string()) // for testing
}
})
.expect("error reading spark.auron.spill.compression.codec")
Expand Down Expand Up @@ -168,10 +168,7 @@ impl Drop for FileSpill {
.add_duration(Duration::from_nanos(self.1.mem_spill_iotime.value() as u64));
if let Some(file_path) = &self.2 {
if let Err(e) = fs::remove_file(file_path) {
warn!(
"Was unable to delete spill file: {}. error: {}",
file_path, e
);
warn!("Was unable to delete spill file: {file_path}. error: {e}");
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions native-engine/auron-planner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ name = "auron-planner"
version = "0.1.0"
edition = "2024"

[lints]
workspace = true

[features]
default = ["prost/no-recursion-limit"]

Expand Down
4 changes: 2 additions & 2 deletions native-engine/auron-planner/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ fn main() -> Result<(), String> {
}
}
if let Some(path) = protoc_file {
eprintln!("Using protoc executable: {:?}", path);
eprintln!("Using protoc executable: {path:?}");
prost_build.protoc_executable(path);
}
prost_build
.compile_protos(&["proto/auron.proto"], &["proto"])
.map_err(|e| format!("protobuf compilation failed: {}", e))
.map_err(|e| format!("protobuf compilation failed: {e}"))
}
16 changes: 8 additions & 8 deletions native-engine/auron-planner/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,22 @@ impl Display for PlanSerDeError {
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
match self {
PlanSerDeError::NotImplemented(desc) => {
write!(f, "Not implemented: {}", desc)
write!(f, "Not implemented: {desc}")
}
PlanSerDeError::General(desc) => write!(f, "General error: {}", desc),
PlanSerDeError::ArrowError(desc) => write!(f, "Arrow error: {}", desc),
PlanSerDeError::General(desc) => write!(f, "General error: {desc}"),
PlanSerDeError::ArrowError(desc) => write!(f, "Arrow error: {desc}"),
PlanSerDeError::DataFusionError(desc) => {
write!(f, "DataFusion error: {:?}", desc)
write!(f, "DataFusion error: {desc:?}")
}
PlanSerDeError::IoError(desc) => write!(f, "IO error: {}", desc),
PlanSerDeError::IoError(desc) => write!(f, "IO error: {desc}"),
PlanSerDeError::Internal(desc) => {
write!(f, "Internal error: {}", desc)
write!(f, "Internal error: {desc}")
}
Self::MissingRequiredField(name) => {
write!(f, "Missing required field {}", name)
write!(f, "Missing required field {name}")
}
Self::UnknownEnumVariant { name, value } => {
write!(f, "Unknown i32 value for {} enum: {}", name, value)
write!(f, "Unknown i32 value for {name} enum: {value}")
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions native-engine/auron-planner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ pub fn from_proto_binary_op(op: &str) -> Result<Operator, PlanSerDeError> {
"RegexNotMatch" => Ok(Operator::RegexNotMatch),
"StringConcat" => Ok(Operator::StringConcat),
other => Err(proto_error(format!(
"Unsupported binary operator '{:?}'",
other
"Unsupported binary operator '{other:?}'"
))),
}
}
Expand Down
Loading
Loading