Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

add clippy to CI #9694

Merged
merged 24 commits into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
10 changes: 10 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,16 @@ cargo-fmt:
- cargo +nightly fmt --all -- --check
allow_failure: true

cargo-clippy:
stage: test
<<: *docker-env
<<: *test-refs
script:
- rustup +nightly component add clippy
gilescope marked this conversation as resolved.
Show resolved Hide resolved
- cargo +nightly install cargo-lints
- cargo +nightly lints clippy
allow_failure: true
TriplEight marked this conversation as resolved.
Show resolved Hide resolved
gilescope marked this conversation as resolved.
Show resolved Hide resolved

cargo-check-benches:
stage: test
<<: *docker-env
Expand Down
131 changes: 131 additions & 0 deletions lints.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
#
gilescope marked this conversation as resolved.
Show resolved Hide resolved
# To run these specific lints run:
#
# cargo install cargo-lints
# cargo lints clippy
#
# For all clippy lints please visit: https://rust-lang.github.io/rust-clippy/master/
#
allow = [
# lints we choose not to enforce:
"clippy::zero_prefixed_literal",
"clippy::tabs_in_doc_comments",
"clippy::type_complexity",

# allow a few lints we've not fixed yet:
# Feel free to raise a PR removing one of these
# (but you will need to fixup the code too!)
"clippy::large_enum_variant",
"clippy::needless_lifetimes",
"clippy::collapsible_if",
"clippy::needless_return",
"clippy::new_without_default",
"clippy::borrowed_box",
"clippy::assign_op_pattern",
"clippy::clone_on_copy",
"clippy::collapsible_else_if",
"clippy::comparison_chain",
"clippy::drop_copy",
"clippy::enum_variant_names",
"clippy::extra_unused_lifetimes",
"clippy::from_over_into",
"clippy::identity_op",
"clippy::into_iter_on_ref",
"clippy::len_without_is_empty",
"clippy::len_zero",
"clippy::let_and_return",
"clippy::many_single_char_names",
"clippy::map_collect_result_unit",
"clippy::match_like_matches_macro",
"clippy::match_ref_pats",
"clippy::mem_replace_with_default",
"clippy::module_inception",
"clippy::mut_from_ref",
"clippy::needless_borrow",
"clippy::needless_collect",
"clippy::needless_doctest_main",
"clippy::needless_range_loop",
"clippy::new_ret_no_self",
"clippy::bind_instead_of_map",
"clippy::comparison_to_empty",
"clippy::nonminimal_bool",
"clippy::single_match",
"clippy::option_as_ref_deref",
"clippy::map_entry",
"clippy::bool_comparison",
"clippy::explicit_counter_loop",
"clippy::clone_double_ref",
"clippy::blacklisted_name",
"clippy::cmp_owned",
"clippy::filter_map_identity",
"clippy::double_must_use",
"clippy::redundant_pattern",
"clippy::eval_order_dependence",
"clippy::from_str_radix_10",
"clippy::clone_double_ref",
"clippy::cmp_owned",
"clippy::redundant_field_names",
"clippy::useless_format",
"clippy::iter_next_slice",
"clippy::blocks_in_if_conditions",
"clippy::if_let_some_result",
"clippy::expect_fun_call",
"clippy::needless_update",
"clippy::manual_strip",
"clippy::print_with_newline",
"clippy::manual_flatten",
"clippy::string_extend_chars",
"clippy::match_overlapping_arm",
"clippy::iter_nth_zero",
"clippy::filter_next",
"clippy::blocks_in_if_conditions",
"clippy::skip_while_next",
"clippy::boxed_local",
"clippy::manual_saturating_arithmetic",
"clippy::unnecessary_filter_map",
"clippy::write_literal",
"clippy::iter_cloned_collect",
"clippy::derive_hash_xor_eq",
"clippy::if_same_then_else",
#"clippy::unwrap_or_else_default",
"clippy::unit_arg",
"clippy::op_ref",
"clippy::field_reassign_with_default",
"clippy::needless_question_mark",
"clippy::map_clone",
"clippy::option_map_unit_fn",
"clippy::or_fun_call",
"clippy::int_plus_one",
"clippy::println_empty_string",
"clippy::ptr_arg",
"clippy::deref_addrof",
"clippy::redundant_clone",
"clippy::redundant_closure",
"clippy::redundant_pattern_matching",
"clippy::redundant_slicing",
"clippy::redundant_static_lifetimes",
"clippy::result_unit_err",
"clippy::search_is_some",
"clippy::should_implement_trait",
"clippy::single_char_add_str",
"clippy::single_component_path_imports",
"clippy::stable_sort_primitive",
"clippy::suspicious_else_formatting",
"clippy::too_many_arguments",
"clippy::try_err",
"clippy::unnecessary_lazy_evaluations",
"clippy::unnecessary_unwrap",
"clippy::unnecessary_mut_passed",
"clippy::unnecessary_cast",
"clippy::unused_unit",
"clippy::unusual_byte_groupings",
"clippy::useless_asref",
"clippy::useless_conversion",
"clippy::vec_init_then_push",
"clippy::while_let_on_iterator",
"clippy::writeln_empty_string",
"clippy::wrong_self_convention"
]
deny = [
]
warn = []