rust/tests/ui-toml
bors 5c6fe68c00 Auto merge of #13376 - decryphe:source-ordering, r=llogiq
new lint: `source_item_ordering`

changelog: [`source_item_ordering`]: Introduced a new restriction lint that checks the ordering of items in Modules, Enums, Structs, Impls and Traits.

From the written documentation:

> Why restrict this?
> Keeping a consistent ordering throughout the codebase helps with working as a team, and possibly improves maintainability of the codebase. The idea is that by defining a consistent and enforceable rule for how source files are structured, less time will be wasted during reviews on a topic that is (under most circumstances) not relevant to the logic implemented in the code. Sometimes this will be referred to as "bike-shedding".
>
> Keep in mind, that ordering source code alphabetically can lead to reduced performance in cases where the most commonly used enum variant isn't the first entry anymore, and similar optimizations that can reduce branch misses, cache locality and such. Either don't use this lint if that's relevant, or disable the lint in modules or items specifically where it matters. Other solutions can be to use profile guided optimization (PGO), or other advanced optimization methods.

I tried to build it as configurable as possible, as such a highly opinionated lint should be adjustable to personal opinions.

I'm open to any input and will be available both here and on the zulip for communication. In the meantime I'll be testing this lint against my own code-bases, which I've (manually) kept ordered with the default config, to see how well it works in practice.

And lastly, a big thanks to the community for making clippy the best linter there is!
2024-11-02 11:03:30 +00:00
..
absolute_paths Merge commit '0f8eabd6231366bfc1bb1464601297c2d48f8f68' into clippyup 2024-08-24 18:33:44 -04:00
allow_mixed_uninlined_format_args
arbitrary_source_item_ordering new lint: source_item_ordering 2024-10-30 10:03:16 +01:00
arithmetic_side_effects_allowed
array_size_threshold Fix large_stack_arrays triggering for static/constants 2024-10-04 19:06:39 +01:00
await_holding_invalid_type Merge commit '37f4fbb92913586b73a35772efd00eccd1cbbe13' into clippy-subtree-update 2024-07-25 18:29:17 +02:00
bad_toml
bad_toml_type
borrow_interior_mutable_const
conf_deprecated_key
dbg_macro Merge commit '9d6f41691ed9dbfaec2a2df2661c42451f2fe0d3' into clippy-subtree-update 2024-03-21 22:20:40 +01:00
decimal_literal_representation
declare_interior_mutable_const
disallowed_macros Merge commit '37f4fbb92913586b73a35772efd00eccd1cbbe13' into clippy-subtree-update 2024-07-25 18:29:17 +02:00
disallowed_names_append Merge commit '7901289135257ca0fbed3a5522526f95b0f5edba' into clippy-subtree-update 2024-09-24 11:58:04 +02:00
disallowed_names_replace Merge commit '7901289135257ca0fbed3a5522526f95b0f5edba' into clippy-subtree-update 2024-09-24 11:58:04 +02:00
disallowed_script_idents
doc_valid_idents_append
doc_valid_idents_replace
duplicated_keys
duplicated_keys_deprecated
duplicated_keys_deprecated_2
enum_variant_size
excessive_nesting Merge commit 'cb806113e0f83a8f9b47d35b453b676543bcc40e' into clippy-subtree-update 2024-08-08 19:13:50 +02:00
expect_used
explicit_iter_loop
extra_unused_type_parameters
fn_params_excessive_bools
functions_maxlines
good_toml_no_false_negatives
ifs_same_cond
impl_trait_in_params
invalid_min_rust_version
item_name_repetitions module_name_repetitions: don't warn if the item is in a private module. 2024-09-23 12:25:01 -07:00
large_futures
large_include_file Extend large_include_file lint to also work on attributes 2024-10-30 20:41:34 +01:00
large_stack_frames Merge commit '9725c4a162502a02c1c67fdca6b797fe09b2b73c' into clippy-subtree-update 2024-04-04 19:52:55 +02:00
large_types_passed_by_value
lint_decimal_readability
macro_metavars_in_unsafe Merge commit '0f8eabd6231366bfc1bb1464601297c2d48f8f68' into clippyup 2024-08-24 18:33:44 -04:00
manual_let_else
max_suggested_slice_pattern_length Merge commit '37f4fbb92913586b73a35772efd00eccd1cbbe13' into clippy-subtree-update 2024-07-25 18:29:17 +02:00
min_ident_chars
min_rust_version
missing_enforced_import_rename Merge commit '7901289135257ca0fbed3a5522526f95b0f5edba' into clippy-subtree-update 2024-09-24 11:58:04 +02:00
module_inception
modulo_arithmetic
mut_key Merge commit '20b085d500dfba5afe0869707bf357af3afe20be' into clippy-subtree-update 2024-05-02 17:26:44 +02:00
needless_pass_by_ref_mut Merge commit 'b794b8e08c16517a941dc598bb1483e8e12a8592' into clippy-subtree-update 2024-07-11 15:44:03 +02:00
needless_raw_string_hashes_one_allowed fix: allow-one-hash-in-raw-strings option of needless_raw_string_hashes was ignored 2024-03-12 10:59:41 +01:00
nonstandard_macro_braces
panic Merge commit '7901289135257ca0fbed3a5522526f95b0f5edba' into clippy-subtree-update 2024-09-24 11:58:04 +02:00
path_ends_with_ext
print_macro
private-doc-errors Add test case for missing_errors_doc at tests with option check-private-items = true 2024-10-27 14:53:20 +05:00
pub_crate_missing_docs
pub_underscore_fields
renamed_function_params Merge commit '2efebd2f0c03dabbe5c3ad7b4ebfbd99238d1fb2' into clippy-subtree-update 2024-05-21 10:39:30 -07:00
result_large_err
semicolon_block
strict_non_send_fields_in_send_ty
struct_excessive_bools
suppress_lint_in_const Merge commit 'aa0d551351a9c15d8a95fdb3e2946b505893dda8' into clippy-subtree-update 2024-10-03 16:32:51 +02:00
toml_disallow
toml_disallowed_methods Merge commit '37f4fbb92913586b73a35772efd00eccd1cbbe13' into clippy-subtree-update 2024-07-25 18:29:17 +02:00
toml_disallowed_types Merge commit '37f4fbb92913586b73a35772efd00eccd1cbbe13' into clippy-subtree-update 2024-07-25 18:29:17 +02:00
toml_trivially_copy
toml_unknown_key new lint: source_item_ordering 2024-10-30 10:03:16 +01:00
too_large_for_stack
too_many_arguments
type_complexity
type_repetition_in_bounds Merge commit '3e5a02b13b1244545454752c6629b767522a44b1' into clippy-subtree-update 2024-06-13 12:30:48 +02:00
undocumented_unsafe_blocks RFC 2383: Stabilize lint_reasons in Clippy 🖇️ 2024-06-25 17:50:48 +02:00
unnecessary_box_returns
unwrap_used Bless clippy. 2024-10-05 00:19:43 +00:00
upper_case_acronyms_aggressive
useless_vec Merge commit '20b085d500dfba5afe0869707bf357af3afe20be' into clippy-subtree-update 2024-05-02 17:26:44 +02:00
vec_box_sized
verbose_bit_mask
wildcard_imports
wildcard_imports_whitelist
zero_single_char_names
update-all-references.sh