Skip to content

Commit

Permalink
ci(cubesql): Turn cargo check to cargo clippy with lots of disabled r…
Browse files Browse the repository at this point in the history
…ules (#8676)
  • Loading branch information
mcheshkov authored Oct 5, 2024
1 parent ad6abec commit 70e5195
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 6 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/rust-cubesql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,12 @@ jobs:
run: cd rust/cubesql && cargo fmt --all -- --check
- name: Lint Native
run: cd packages/cubejs-backend-native && cargo fmt --all -- --check
# TODO replace with clippy once cubesql is ready
- name: Check CubeSQL
run: cd rust/cubesql && cargo check --locked --workspace --all-targets --keep-going
- name: Clippy CubeSQL
run: cd rust/cubesql && cargo clippy --locked --workspace --all-targets --keep-going -- -D warnings
- name: Clippy Native
run: cd packages/cubejs-backend-native && cargo clippy --locked --workspace --all-targets --keep-going -- -D warnings
- name: Clippy Native (with Python)
run: cd packages/cubejs-backend-native && cargo clippy --locked --workspace --all-targets --keep-going --features python -- -D warnings
# CubeSQL is not ready for Clippy
#- name: Clippy CubeSQL
# run: cd rust/cubesql && cargo clippy -- -D warnings

unit:
# We use host instead of cross container, because it's much faster
Expand Down
87 changes: 87 additions & 0 deletions rust/cubesql/cubesql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,90 @@ harness = false
[[bench]]
name = "large_model"
harness = false

# Code in cubesql workspace is not ready for full-blown clippy
# So we disable some rules to enable per-rule latch in CI, not for a whole clippy run
# Feel free to remove any rule from here and fix all warnings with it
# Or to write a comment why rule should stay disabled
[lints.clippy]
assign_op_pattern = "allow"
bool_assert_comparison = "allow"
bool_comparison = "allow"
borrowed_box = "allow"
cast_abs_to_unsigned = "allow"
clone_on_copy = "allow"
cmp_owned = "allow"
collapsible_if = "allow"
collapsible_match = "allow"
collapsible_else_if = "allow"
comparison_chain = "allow"
derive_ord_xor_partial_ord = "allow"
expect_fun_call = "allow"
explicit_auto_deref = "allow"
extra_unused_lifetimes = "allow"
field_reassign_with_default = "allow"
filter_map_bool_then = "allow"
filter_map_identity = "allow"
for_kv_map = "allow"
get_first = "allow"
identity_op = "allow"
if_same_then_else = "allow"
into_iter_on_ref = "allow"
iter_cloned_collect = "allow"
iter_next_slice = "allow"
len_without_is_empty = "allow"
len_zero = "allow"
let_and_return = "allow"
manual_filter = "allow"
manual_flatten = "allow"
manual_is_ascii_check = "allow"
manual_map = "allow"
manual_range_contains = "allow"
manual_strip = "allow"
map_clone = "allow"
map_flatten = "allow"
map_identity = "allow"
match_like_matches_macro = "allow"
match_ref_pats = "allow"
match_single_binding = "allow"
missing_transmute_annotations = "allow"
needless_borrow = "allow"
needless_borrows_for_generic_args = "allow"
needless_late_init = "allow"
needless_lifetimes = "allow"
needless_question_mark = "allow"
needless_range_loop = "allow"
needless_return = "allow"
neg_multiply = "allow"
never_loop = "allow"
new_without_default = "allow"
non_canonical_partial_ord_impl = "allow"
nonminimal_bool = "allow"
only_used_in_recursion = "allow"
op_ref = "allow"
option_as_ref_deref = "allow"
partialeq_ne_impl = "allow"
ptr_arg = "allow"
redundant_closure = "allow"
redundant_field_names = "allow"
redundant_pattern = "allow"
redundant_pattern_matching = "allow"
redundant_slicing = "allow"
result_large_err = "allow"
single_match = "allow"
should_implement_trait = "allow"
to_string_in_format_args = "allow"
to_string_trait_impl = "allow"
too_many_arguments = "allow"
type_complexity = "allow"
unnecessary_cast = "allow"
unnecessary_lazy_evaluations = "allow"
unnecessary_mut_passed = "allow"
unnecessary_to_owned = "allow"
unnecessary_unwrap = "allow"
unused_unit = "allow"
unwrap_or_default = "allow"
useless_conversion = "allow"
useless_format = "allow"
useless_vec = "allow"
wrong_self_convention = "allow"
11 changes: 11 additions & 0 deletions rust/cubesql/pg-srv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@ chrono = { version = "0.4", package = "chrono", default-features = false, featur
[dev-dependencies]
hex = "0.4.3"

# Code in cubesql workspace is not ready for full-blown clippy
# So we disable some rules to enable per-rule latch in CI, not for a whole clippy run
# Feel free to remove any rule from here and fix all warnings with it
# Or to write a comment why rule should stay disabled
[lints.clippy]
len_without_is_empty = "allow"
new_without_default = "allow"
redundant_slicing = "allow"
single_char_add_str = "allow"
single_match = "allow"
to_string_trait_impl = "allow"

0 comments on commit 70e5195

Please sign in to comment.