Skip to content

Commit

Permalink
refactor: enable clippy::pedantic lint group (#282)
Browse files Browse the repository at this point in the history
# Rationale for this change

We have cargo clippy running in our CI in order to enforce code quality.
In order to increase our standards, we should enable the
clippy::pedantic lint group.

# What changes are included in this PR?

This PR adds pedantic lint check to the toml file, replacing the
existing individual lint checks that are part of pedantic group.

# Are these changes tested?

Yes.
  • Loading branch information
mehulmathur16 authored Oct 19, 2024
1 parent fd3a339 commit 863d9f3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 47 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ jobs:
run: export DEBIAN_FRONTEND=non-interactive && sudo apt-get update && sudo apt-get install -y clang lld
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run clippy::pedantic for proof-of-sql-parser
run: cargo clippy --lib -p proof-of-sql-parser -- -D clippy::pedantic

coverage:
name: Code Coverage
Expand Down
46 changes: 2 additions & 44 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,47 +65,5 @@ zerocopy = { version = "0.7.34" }
missing_docs = "warn"

[workspace.lints.clippy]
missing_panics_doc = "deny"
doc_markdown = "deny"
match_same_arms = "deny"
similar_names = "deny"
many_single_char_names = "deny"
explicit_iter_loop = "deny"
implicit_clone = "deny"
uninlined_format_args = "deny"
semicolon_if_nothing_returned = "deny"
unnested_or_patterns = "deny"
unreadable_literal = "deny"
must_use_candidate = "deny"
range_plus_one = "deny"
cloned_instead_of_copied = "deny"
from_iter_instead_of_collect = "deny"
cast_lossless = "deny"
redundant_closure_for_method_calls = "deny"
inconsistent_struct_constructor = "deny"
default_trait_access = "deny"
module_name_repetitions = "deny"
wildcard_imports = "deny"
unused_self = "deny"
manual_let_else = "deny"
struct_field_names = "deny"
unicode_not_nfc = "deny"
manual_string_new = "deny"
large_types_passed_by_value = "deny"
map_unwrap_or = "deny"
if_not_else = "deny"
explicit_deref_methods = "deny"
items_after_statements = "deny"
bool_to_int_with_if = "deny"
ptr_as_ptr = "deny"
match_wildcard_for_single_variants = "deny"
match_bool = "deny"
manual_assert = "deny"
trivially_copy_pass_by_ref = "deny"
unnecessary_wraps = "deny"
should_panic_without_expect = "deny"
needless_pass_by_value = "deny"
too_many_lines = "deny"
cast_possible_wrap = "deny"
cast_sign_loss = "deny"
cast_possible_truncation = "deny"
missing_errors_doc = "allow"
pedantic = { level = "warn", priority = -1 }
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ pub fn bit_table_and_scalars_for_packed_msm(

// Add offsets to handle signed values to the bit table.
bit_table.extend(
iter::repeat(u32::try_from(BYTE_SIZE).unwrap_or(u32::MAX))
iter::repeat(u32::try_from(BYTE_SIZE).expect("BYTE_SIZE fits in u32"))
.take(OFFSET_SIZE + committable_columns.len()),
);
let bit_table_full_sum_in_bytes = bit_table.iter().sum::<u32>() as usize / BYTE_SIZE;
Expand Down

0 comments on commit 863d9f3

Please sign in to comment.