RFC 344 mentions a naming convention for lints, and I think that going through the names of the lints clippy offers to be more consistent would be a good idea.
The full list of lints is here: https://rust-lang-nursery.github.io/rust-clippy/master/index.html
I'll be updating this as I go through the lints with what extra conventions on top of what RFC 344 offers should be added to help clippy create better lint names. :)
Lint rules:
unused is used across Rust lints. For now, I can think of incorrect, excessive, redundant, temporary, and undefined as a few big keywords.val as a placeholder for a variable name.types.construct_in_XXX_function.undefined.Lint changes:
almost_swapped, following rule 1, should be incorrect_swapsapprox_constant should be approximate_known_constantsassign_op_pattern definitely should have a different name but I'm not sure whatborrowed_box should be renamed to redundant_boxes and include other lints like boxed_localfor_loop_over_option and for_loop_over_result, following rules 2 and 8, should be for_val_in_optioniter_next_loop, following rule 2, should be for_val_in_iter_nextdeprecated_semver should be non_semver_deprecations, because rather than drop_copy, following rule 3, should be drop_copy_typesnot_unsafe_ptr_arg_deref, following rule 4, should be deref_ptr_arg_in_safe_functionslogic_bug should explain what it's linting and be renamed to unused_short_circuitspossible_missing_comma, by rule 5, should be renamed to multiline_binops_in_arraywrong_transmute, by rule 6, should be undefined_transmutesinvalid_regex, by rule 1, should be incorrect_regexesmin_max, following rule 1, should be incorrect_clampsunit_cmp should be unit_comparisons by 7reverse_range_loop, by 1 should be incorrect_reversed_rangessuspicious_arithmetic_impl by 5 should be incorrect_op_in_impl_opsuspicious_op_assign_impl by 5 should be incorrect_op_in_impl_op_assign, or combined with incorrect_op_in_impl_opfloat_cmp should be float_comparisons by 7zero_width_space should be zero_width_spacesfn_to_numeric_cast_with_truncation should be truncating_fn_ptr_as_int by 2while_immutable_condition should be while_immutable_val by 2never_loop should be infinite_loopsinfinite_iter should be infinite_loops, unless we're still not sure about the quality of never_loop and want to add an infinite_iter_loops in the meantimenonsensical_open_options should be unused_file_optionsforget_copy should be forget_copy_typesif_same_then_else and ifs_same_cond should be combined into unused_ifcast_ptr_alignment should be incorrectly_aligned_ptr_castsmodulo_one, erasing_op, ineffective_bit_mask should be combined into unused_operationsinline_fn_without_body should be empty_inline_fnmut_from_ref should be returning_mut_ref_from_refinvalid_ref should be undefined_referencesserde_api_misuse probably needs a different name but idk what it should bematch_bool should be match_bool_typescmp_null should be null_comparisonswrite_with_newline and print_with_newline should be print_val_newlineunneeded_field_pattern should be unused_field_patternsnew_without_default_derive might need a new name or rulezero_ptr should be zero_as_ptrwrong_self_convention should be incorrect_self_conventionsinconsistent_digit_grouping should be inconsistent_digit_groups to match large_digit_groupsrange_minus_one should be inclusive_ranges_to_val_minus_one (I don't like how long it is, but I can't think of anything better?)regex_macro should be incorrect_regex_macro_callsop_ref should be referencing_comparisonsquestion_mark should be incorrect_triesredundant_closure should be unused_closuresptr_arg should be smart_ptr_argumentschars_last_cmp should be chars_last_eq_charblacklisted_name should be blacklisted_namesdouble_neg should be double_negationsunnecessary_fold should be unspecialized_foldslet_unit_value should be unit_variablesneedless_range_loop should be redundant_index_loopsexcessive_precision should be excessive_precision_float_literalsduplicate_underscore_argument should be double_underscore_argumentspanic_params should be missing_panic_argumentswriteln_empty_string should be part of println_empty_stringinfallible_destructuring_match should be part of infalliable_matchesblock_in_if_condition_stmt should be statements_in_if_conditionsunreadable_literal should be unreadable_literalsunsafe_removed_from_name should be import_unsafe_as_safebuiltin_type_shadow should be builtin_type_shadowingneg_multiply should be times_negative_oneconst_static_lifetime should be unused_static_lifetimesexplicit_iter_loop should be explicit_forsingle_match should be explicit_if_letfor_kv_map should be excessive_entry_iteratorsyou can use ./util/update-lints.py -n to dump a markdown list of lints
needless and useless are basically used as synonyms in a few lint names. It would be more consistent to use just one. needless is used more often and useless has negative connotations so I prefer needless.
So you all know, I just looked at a bunch of lints and came up with a fair number of new rules. I'd love feedback on some of these.
I mostly read down @Manishearth's RFC and figured out new names for lints.
needlessanduselessare basically used as synonyms in a few lint names. It would be more consistent to use just one.needlessis used more often anduselesshas negative connotations so I preferneedless.
Not a native English speaker, I wonder if the same would be the case for unnecessary? We have a couple of those, too:
unnecessary_castunnecessary_filter_mapunnecessary_foldunnecessary_mut_passedunnecessary_operationunnecessary_unwrapUsing needless would make the lint names a bit shorter and easier to write.
Most helpful comment
needlessanduselessare basically used as synonyms in a few lint names. It would be more consistent to use just one.needlessis used more often anduselesshas negative connotations so I preferneedless.