Skip to content

Commit 70e5195

Browse files
authored
ci(cubesql): Turn cargo check to cargo clippy with lots of disabled rules (#8676)
1 parent ad6abec commit 70e5195

File tree

3 files changed

+100
-6
lines changed

3 files changed

+100
-6
lines changed

.github/workflows/rust-cubesql.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,12 @@ jobs:
4343
run: cd rust/cubesql && cargo fmt --all -- --check
4444
- name: Lint Native
4545
run: cd packages/cubejs-backend-native && cargo fmt --all -- --check
46-
# TODO replace with clippy once cubesql is ready
47-
- name: Check CubeSQL
48-
run: cd rust/cubesql && cargo check --locked --workspace --all-targets --keep-going
46+
- name: Clippy CubeSQL
47+
run: cd rust/cubesql && cargo clippy --locked --workspace --all-targets --keep-going -- -D warnings
4948
- name: Clippy Native
5049
run: cd packages/cubejs-backend-native && cargo clippy --locked --workspace --all-targets --keep-going -- -D warnings
5150
- name: Clippy Native (with Python)
5251
run: cd packages/cubejs-backend-native && cargo clippy --locked --workspace --all-targets --keep-going --features python -- -D warnings
53-
# CubeSQL is not ready for Clippy
54-
#- name: Clippy CubeSQL
55-
# run: cd rust/cubesql && cargo clippy -- -D warnings
5652

5753
unit:
5854
# We use host instead of cross container, because it's much faster

rust/cubesql/cubesql/Cargo.toml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,90 @@ harness = false
8383
[[bench]]
8484
name = "large_model"
8585
harness = false
86+
87+
# Code in cubesql workspace is not ready for full-blown clippy
88+
# So we disable some rules to enable per-rule latch in CI, not for a whole clippy run
89+
# Feel free to remove any rule from here and fix all warnings with it
90+
# Or to write a comment why rule should stay disabled
91+
[lints.clippy]
92+
assign_op_pattern = "allow"
93+
bool_assert_comparison = "allow"
94+
bool_comparison = "allow"
95+
borrowed_box = "allow"
96+
cast_abs_to_unsigned = "allow"
97+
clone_on_copy = "allow"
98+
cmp_owned = "allow"
99+
collapsible_if = "allow"
100+
collapsible_match = "allow"
101+
collapsible_else_if = "allow"
102+
comparison_chain = "allow"
103+
derive_ord_xor_partial_ord = "allow"
104+
expect_fun_call = "allow"
105+
explicit_auto_deref = "allow"
106+
extra_unused_lifetimes = "allow"
107+
field_reassign_with_default = "allow"
108+
filter_map_bool_then = "allow"
109+
filter_map_identity = "allow"
110+
for_kv_map = "allow"
111+
get_first = "allow"
112+
identity_op = "allow"
113+
if_same_then_else = "allow"
114+
into_iter_on_ref = "allow"
115+
iter_cloned_collect = "allow"
116+
iter_next_slice = "allow"
117+
len_without_is_empty = "allow"
118+
len_zero = "allow"
119+
let_and_return = "allow"
120+
manual_filter = "allow"
121+
manual_flatten = "allow"
122+
manual_is_ascii_check = "allow"
123+
manual_map = "allow"
124+
manual_range_contains = "allow"
125+
manual_strip = "allow"
126+
map_clone = "allow"
127+
map_flatten = "allow"
128+
map_identity = "allow"
129+
match_like_matches_macro = "allow"
130+
match_ref_pats = "allow"
131+
match_single_binding = "allow"
132+
missing_transmute_annotations = "allow"
133+
needless_borrow = "allow"
134+
needless_borrows_for_generic_args = "allow"
135+
needless_late_init = "allow"
136+
needless_lifetimes = "allow"
137+
needless_question_mark = "allow"
138+
needless_range_loop = "allow"
139+
needless_return = "allow"
140+
neg_multiply = "allow"
141+
never_loop = "allow"
142+
new_without_default = "allow"
143+
non_canonical_partial_ord_impl = "allow"
144+
nonminimal_bool = "allow"
145+
only_used_in_recursion = "allow"
146+
op_ref = "allow"
147+
option_as_ref_deref = "allow"
148+
partialeq_ne_impl = "allow"
149+
ptr_arg = "allow"
150+
redundant_closure = "allow"
151+
redundant_field_names = "allow"
152+
redundant_pattern = "allow"
153+
redundant_pattern_matching = "allow"
154+
redundant_slicing = "allow"
155+
result_large_err = "allow"
156+
single_match = "allow"
157+
should_implement_trait = "allow"
158+
to_string_in_format_args = "allow"
159+
to_string_trait_impl = "allow"
160+
too_many_arguments = "allow"
161+
type_complexity = "allow"
162+
unnecessary_cast = "allow"
163+
unnecessary_lazy_evaluations = "allow"
164+
unnecessary_mut_passed = "allow"
165+
unnecessary_to_owned = "allow"
166+
unnecessary_unwrap = "allow"
167+
unused_unit = "allow"
168+
unwrap_or_default = "allow"
169+
useless_conversion = "allow"
170+
useless_format = "allow"
171+
useless_vec = "allow"
172+
wrong_self_convention = "allow"

rust/cubesql/pg-srv/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,14 @@ chrono = { version = "0.4", package = "chrono", default-features = false, featur
2626
[dev-dependencies]
2727
hex = "0.4.3"
2828

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

0 commit comments

Comments
 (0)