diff options
author | Tim Oram <dev@mitmaro.ca> | 2023-09-06 09:08:11 -0230 |
---|---|---|
committer | Tim Oram <dev@mitmaro.ca> | 2023-09-06 22:45:22 -0230 |
commit | d7655157ff5d8e199291575b2ac0d1ac6267d69f (patch) | |
tree | 53f1503fce34e8439a59c25eaabc5238bfea93c6 | |
parent | 7d324c2843b0b1fba7de3ad3dc0eacd8a7ac2114 (diff) |
Fix latest linting errors
-rw-r--r-- | scripts/data/lints.rs | 19 | ||||
-rw-r--r-- | src/config/src/lib.rs | 19 | ||||
-rw-r--r-- | src/core/src/lib.rs | 19 | ||||
-rw-r--r-- | src/core/src/modules/external_editor/mod.rs | 2 | ||||
-rw-r--r-- | src/display/src/lib.rs | 19 | ||||
-rw-r--r-- | src/git/src/file_status_builder.rs | 4 | ||||
-rw-r--r-- | src/git/src/lib.rs | 19 | ||||
-rw-r--r-- | src/input/src/lib.rs | 19 | ||||
-rw-r--r-- | src/main.rs | 25 | ||||
-rw-r--r-- | src/runtime/src/lib.rs | 19 | ||||
-rw-r--r-- | src/runtime/src/thread_statuses.rs | 2 | ||||
-rw-r--r-- | src/testutils/src/lib.rs | 19 | ||||
-rw-r--r-- | src/todo_file/src/lib.rs | 19 | ||||
-rw-r--r-- | src/view/src/lib.rs | 19 |
14 files changed, 84 insertions, 139 deletions
diff --git a/scripts/data/lints.rs b/scripts/data/lints.rs index 8ab2ba9..5484100 100644 --- a/scripts/data/lints.rs +++ b/scripts/data/lints.rs @@ -64,17 +64,23 @@ clippy::implicit_return, clippy::indexing_slicing, clippy::map_err_ignore, + clippy::min_ident_chars, clippy::missing_docs_in_private_items, clippy::missing_trait_methods, clippy::mod_module_files, clippy::module_name_repetitions, + clippy::needless_raw_strings, clippy::new_without_default, clippy::non_ascii_literal, clippy::option_if_let_else, + clippy::pattern_type_mismatch, clippy::pub_use, + clippy::pub_with_shorthand, clippy::question_mark_used, + clippy::redundant_closure_call, clippy::redundant_pub_crate, clippy::ref_patterns, + clippy::single_call_fn, clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::tabs_in_doc_comments, @@ -109,15 +115,4 @@ ) )] // allowable upcoming nightly lints -#![cfg_attr( - include_nightly_lints, - allow( - clippy::absolute_paths, - clippy::arc_with_non_send_sync, - clippy::min_ident_chars, - clippy::needless_raw_strings, - clippy::pub_with_shorthand, - clippy::redundant_closure_call, - clippy::single_call_fn - ) -)] +#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))] diff --git a/src/config/src/lib.rs b/src/config/src/lib.rs index 6f036a8..5c45d25 100644 --- a/src/config/src/lib.rs +++ b/src/config/src/lib.rs @@ -65,17 +65,23 @@ clippy::implicit_return, clippy::indexing_slicing, clippy::map_err_ignore, + clippy::min_ident_chars, clippy::missing_docs_in_private_items, clippy::missing_trait_methods, clippy::mod_module_files, clippy::module_name_repetitions, + clippy::needless_raw_strings, clippy::new_without_default, clippy::non_ascii_literal, clippy::option_if_let_else, + clippy::pattern_type_mismatch, clippy::pub_use, + clippy::pub_with_shorthand, clippy::question_mark_used, + clippy::redundant_closure_call, clippy::redundant_pub_crate, clippy::ref_patterns, + clippy::single_call_fn, clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::tabs_in_doc_comments, @@ -110,18 +116,7 @@ ) )] // allowable upcoming nightly lints -#![cfg_attr( - include_nightly_lints, - allow( - clippy::absolute_paths, - clippy::arc_with_non_send_sync, - clippy::min_ident_chars, - clippy::needless_raw_strings, - clippy::pub_with_shorthand, - clippy::redundant_closure_call, - clippy::single_call_fn - ) -)] +#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))] // LINT-REPLACE-END //! Git Interactive Rebase Tool - Configuration Module diff --git a/src/core/src/lib.rs b/src/core/src/lib.rs index b54f875..a66ed33 100644 --- a/src/core/src/lib.rs +++ b/src/core/src/lib.rs @@ -65,17 +65,23 @@ clippy::implicit_return, clippy::indexing_slicing, clippy::map_err_ignore, + clippy::min_ident_chars, clippy::missing_docs_in_private_items, clippy::missing_trait_methods, clippy::mod_module_files, clippy::module_name_repetitions, + clippy::needless_raw_strings, clippy::new_without_default, clippy::non_ascii_literal, clippy::option_if_let_else, + clippy::pattern_type_mismatch, clippy::pub_use, + clippy::pub_with_shorthand, clippy::question_mark_used, + clippy::redundant_closure_call, clippy::redundant_pub_crate, clippy::ref_patterns, + clippy::single_call_fn, clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::tabs_in_doc_comments, @@ -110,18 +116,7 @@ ) )] // allowable upcoming nightly lints -#![cfg_attr( - include_nightly_lints, - allow( - clippy::absolute_paths, - clippy::arc_with_non_send_sync, - clippy::min_ident_chars, - clippy::needless_raw_strings, - clippy::pub_with_shorthand, - clippy::redundant_closure_call, - clippy::single_call_fn - ) -)] +#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))] // LINT-REPLACE-END // TODO deny clippy::same_name_method again once bitflags/bitflags#374 is merged #![allow( diff --git a/src/core/src/modules/external_editor/mod.rs b/src/core/src/modules/external_editor/mod.rs index 5ba2de8..35aac76 100644 --- a/src/core/src/modules/external_editor/mod.rs +++ b/src/core/src/modules/external_editor/mod.rs @@ -102,7 +102,7 @@ impl Module for ExternalEditor { let mut todo_file = self.todo_file.lock(); let result = todo_file.load_file(); let state = match result { - Ok(_) => { + Ok(()) => { if todo_file.is_empty() || todo_file.is_noop() { Some(ExternalEditorState::Empty) } diff --git a/src/display/src/lib.rs b/src/display/src/lib.rs index e31a7e5..d4297cd 100644 --- a/src/display/src/lib.rs +++ b/src/display/src/lib.rs @@ -65,17 +65,23 @@ clippy::implicit_return, clippy::indexing_slicing, clippy::map_err_ignore, + clippy::min_ident_chars, clippy::missing_docs_in_private_items, clippy::missing_trait_methods, clippy::mod_module_files, clippy::module_name_repetitions, + clippy::needless_raw_strings, clippy::new_without_default, clippy::non_ascii_literal, clippy::option_if_let_else, + clippy::pattern_type_mismatch, clippy::pub_use, + clippy::pub_with_shorthand, clippy::question_mark_used, + clippy::redundant_closure_call, clippy::redundant_pub_crate, clippy::ref_patterns, + clippy::single_call_fn, clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::tabs_in_doc_comments, @@ -110,18 +116,7 @@ ) )] // allowable upcoming nightly lints -#![cfg_attr( - include_nightly_lints, - allow( - clippy::absolute_paths, - clippy::arc_with_non_send_sync, - clippy::min_ident_chars, - clippy::needless_raw_strings, - clippy::pub_with_shorthand, - clippy::redundant_closure_call, - clippy::single_call_fn - ) -)] +#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))] // LINT-REPLACE-END //! Git Interactive Rebase Tool - Display Module diff --git a/src/git/src/file_status_builder.rs b/src/git/src/file_status_builder.rs index 1dcacce..968b5df 100644 --- a/src/git/src/file_status_builder.rs +++ b/src/git/src/file_status_builder.rs @@ -242,7 +242,7 @@ mod tests { } #[test] - #[should_panic] + #[should_panic(expected = "add_file_stat must be called once before adding a delta")] fn add_delta_without_file_stat() { let mut file_stats_builder = FileStatusBuilder::new(); file_stats_builder.add_delta(Delta::new("@ path/to/file.rs:56 @ impl Delta {", 10, 12, 3, 4)); @@ -250,7 +250,7 @@ mod tests { } #[test] - #[should_panic] + #[should_panic(expected = "add_delta must be called once before adding a diff line")] fn add_diff_line_before_delta() { let mut file_stats_builder = FileStatusBuilder::new(); file_stats_builder.add_file_stat(FileStatus::new( diff --git a/src/git/src/lib.rs b/src/git/src/lib.rs index caa932e..407aa91 100644 --- a/src/git/src/lib.rs +++ b/src/git/src/lib.rs @@ -65,17 +65,23 @@ clippy::implicit_return, clippy::indexing_slicing, clippy::map_err_ignore, + clippy::min_ident_chars, clippy::missing_docs_in_private_items, clippy::missing_trait_methods, clippy::mod_module_files, clippy::module_name_repetitions, + clippy::needless_raw_strings, clippy::new_without_default, clippy::non_ascii_literal, clippy::option_if_let_else, + clippy::pattern_type_mismatch, clippy::pub_use, + clippy::pub_with_shorthand, clippy::question_mark_used, + clippy::redundant_closure_call, clippy::redundant_pub_crate, clippy::ref_patterns, + clippy::single_call_fn, clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::tabs_in_doc_comments, @@ -110,18 +116,7 @@ ) )] // allowable upcoming nightly lints -#![cfg_attr( - include_nightly_lints, - allow( - clippy::absolute_paths, - clippy::arc_with_non_send_sync, - clippy::min_ident_chars, - clippy::needless_raw_strings, - clippy::pub_with_shorthand, - clippy::redundant_closure_call, - clippy::single_call_fn - ) -)] +#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))] // LINT-REPLACE-END //! Git Interactive Rebase Tool - Git Module diff --git a/src/input/src/lib.rs b/src/input/src/lib.rs index 00b0929..cc2d873 100644 --- a/src/input/src/lib.rs +++ b/src/input/src/lib.rs @@ -65,17 +65,23 @@ clippy::implicit_return, clippy::indexing_slicing, clippy::map_err_ignore, + clippy::min_ident_chars, clippy::missing_docs_in_private_items, clippy::missing_trait_methods, clippy::mod_module_files, clippy::module_name_repetitions, + clippy::needless_raw_strings, clippy::new_without_default, clippy::non_ascii_literal, clippy::option_if_let_else, + clippy::pattern_type_mismatch, clippy::pub_use, + clippy::pub_with_shorthand, clippy::question_mark_used, + clippy::redundant_closure_call, clippy::redundant_pub_crate, clippy::ref_patterns, + clippy::single_call_fn, clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::tabs_in_doc_comments, @@ -110,18 +116,7 @@ ) )] // allowable upcoming nightly lints -#![cfg_attr( - include_nightly_lints, - allow( - clippy::absolute_paths, - clippy::arc_with_non_send_sync, - clippy::min_ident_chars, - clippy::needless_raw_strings, - clippy::pub_with_shorthand, - clippy::redundant_closure_call, - clippy::single_call_fn - ) -)] +#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))] // LINT-REPLACE-END // TODO deny clippy::same_name_method again once bitflags/bitflags#374 is merged #![allow(clippy::same_name_method)] diff --git a/src/main.rs b/src/main.rs index 085b660..54ff2bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,17 +65,23 @@ clippy::implicit_return, clippy::indexing_slicing, clippy::map_err_ignore, + clippy::min_ident_chars, clippy::missing_docs_in_private_items, clippy::missing_trait_methods, clippy::mod_module_files, clippy::module_name_repetitions, + clippy::needless_raw_strings, clippy::new_without_default, clippy::non_ascii_literal, clippy::option_if_let_else, + clippy::pattern_type_mismatch, clippy::pub_use, + clippy::pub_with_shorthand, clippy::question_mark_used, + clippy::redundant_closure_call, clippy::redundant_pub_crate, clippy::ref_patterns, + clippy::single_call_fn, clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::tabs_in_doc_comments, @@ -110,30 +116,19 @@ ) )] // allowable upcoming nightly lints -#![cfg_attr( - include_nightly_lints, - allow( - clippy::absolute_paths, - clippy::arc_with_non_send_sync, - clippy::min_ident_chars, - clippy::needless_raw_strings, - clippy::pub_with_shorthand, - clippy::redundant_closure_call, - clippy::single_call_fn - ) -)] +#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))] // LINT-REPLACE-END #![allow(missing_docs, rustdoc::missing_crate_level_docs)] -use std::env::args_os; +use std::{env, process}; // TODO use the termination trait once rust-lang/rust#43301 is stable #[allow(clippy::exit, clippy::print_stderr)] #[cfg(not(tarpaulin_include))] fn main() { - let exit = core::run(args_os().skip(1).collect()); + let exit = core::run(env::args_os().skip(1).collect()); if let Some(message) = exit.get_message().as_ref() { eprintln!("{message}"); } - std::process::exit(exit.get_status().to_code()); + process::exit(exit.get_status().to_code()); } diff --git a/src/runtime/src/lib.rs b/src/runtime/src/lib.rs index 7ba30e0..08ecd21 100644 --- a/src/runtime/src/lib.rs +++ b/src/runtime/src/lib.rs @@ -65,17 +65,23 @@ clippy::implicit_return, clippy::indexing_slicing, clippy::map_err_ignore, + clippy::min_ident_chars, clippy::missing_docs_in_private_items, clippy::missing_trait_methods, clippy::mod_module_files, clippy::module_name_repetitions, + clippy::needless_raw_strings, clippy::new_without_default, clippy::non_ascii_literal, clippy::option_if_let_else, + clippy::pattern_type_mismatch, clippy::pub_use, + clippy::pub_with_shorthand, clippy::question_mark_used, + clippy::redundant_closure_call, clippy::redundant_pub_crate, clippy::ref_patterns, + clippy::single_call_fn, clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::tabs_in_doc_comments, @@ -110,18 +116,7 @@ ) )] // allowable upcoming nightly lints -#![cfg_attr( - include_nightly_lints, - allow( - clippy::absolute_paths, - clippy::arc_with_non_send_sync, - clippy::min_ident_chars, - clippy::needless_raw_strings, - clippy::pub_with_shorthand, - clippy::redundant_closure_call, - clippy::single_call_fn - ) -)] +#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))] // LINT-REPLACE-END #![allow(clippy::as_conversions, clippy::cast_possible_truncation)] diff --git a/src/runtime/src/thread_statuses.rs b/src/runtime/src/thread_statuses.rs index 30023fe..9907f7b 100644 --- a/src/runtime/src/thread_statuses.rs +++ b/src/runtime/src/thread_statuses.rs @@ -131,7 +131,7 @@ mod tests { } #[test] - #[should_panic] + #[should_panic(expected = "Attempt to register more than one threads with name: name")] fn register_thread_same_name() { let statuses = ThreadStatuses::new(); statuses.register_thread("name", Status::New); diff --git a/src/testutils/src/lib.rs b/src/testutils/src/lib.rs index 648e85b..85d017b 100644 --- a/src/testutils/src/lib.rs +++ b/src/testutils/src/lib.rs @@ -65,17 +65,23 @@ clippy::implicit_return, clippy::indexing_slicing, clippy::map_err_ignore, + clippy::min_ident_chars, clippy::missing_docs_in_private_items, clippy::missing_trait_methods, clippy::mod_module_files, clippy::module_name_repetitions, + clippy::needless_raw_strings, clippy::new_without_default, clippy::non_ascii_literal, clippy::option_if_let_else, + clippy::pattern_type_mismatch, clippy::pub_use, + clippy::pub_with_shorthand, clippy::question_mark_used, + clippy::redundant_closure_call, clippy::redundant_pub_crate, clippy::ref_patterns, + clippy::single_call_fn, clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::tabs_in_doc_comments, @@ -110,18 +116,7 @@ ) )] // allowable upcoming nightly lints -#![cfg_attr( - include_nightly_lints, - allow( - clippy::absolute_paths, - clippy::arc_with_non_send_sync, - clippy::min_ident_chars, - clippy::needless_raw_strings, - clippy::pub_with_shorthand, - clippy::redundant_closure_call, - clippy::single_call_fn - ) -)] +#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))] // LINT-REPLACE-END //! Git Interactive Rebase Tool - Test Utils diff --git a/src/todo_file/src/lib.rs b/src/todo_file/src/lib.rs index 126cd1c..5ef9e09 100644 --- a/src/todo_file/src/lib.rs +++ b/src/todo_file/src/lib.rs @@ -65,17 +65,23 @@ clippy::implicit_return, clippy::indexing_slicing, clippy::map_err_ignore, + clippy::min_ident_chars, clippy::missing_docs_in_private_items, clippy::missing_trait_methods, clippy::mod_module_files, clippy::module_name_repetitions, + clippy::needless_raw_strings, clippy::new_without_default, clippy::non_ascii_literal, clippy::option_if_let_else, + clippy::pattern_type_mismatch, clippy::pub_use, + clippy::pub_with_shorthand, clippy::question_mark_used, + clippy::redundant_closure_call, clippy::redundant_pub_crate, clippy::ref_patterns, + clippy::single_call_fn, clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::tabs_in_doc_comments, @@ -110,18 +116,7 @@ ) )] // allowable upcoming nightly lints -#![cfg_attr( - include_nightly_lints, - allow( - clippy::absolute_paths, - clippy::arc_with_non_send_sync, - clippy::min_ident_chars, - clippy::needless_raw_strings, - clippy::pub_with_shorthand, - clippy::redundant_closure_call, - clippy::single_call_fn - ) -)] +#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))] // LINT-REPLACE-END //! Git Interactive Rebase Tool - Todo File Module diff --git a/src/view/src/lib.rs b/src/view/src/lib.rs index 7891aa5..d54381b 100644 --- a/src/view/src/lib.rs +++ b/src/view/src/lib.rs @@ -65,17 +65,23 @@ clippy::implicit_return, clippy::indexing_slicing, clippy::map_err_ignore, + clippy::min_ident_chars, clippy::missing_docs_in_private_items, clippy::missing_trait_methods, clippy::mod_module_files, clippy::module_name_repetitions, + clippy::needless_raw_strings, clippy::new_without_default, clippy::non_ascii_literal, clippy::option_if_let_else, + clippy::pattern_type_mismatch, clippy::pub_use, + clippy::pub_with_shorthand, clippy::question_mark_used, + clippy::redundant_closure_call, clippy::redundant_pub_crate, clippy::ref_patterns, + clippy::single_call_fn, clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::tabs_in_doc_comments, @@ -110,18 +116,7 @@ ) )] // allowable upcoming nightly lints -#![cfg_attr( - include_nightly_lints, - allow( - clippy::absolute_paths, - clippy::arc_with_non_send_sync, - clippy::min_ident_chars, - clippy::needless_raw_strings, - clippy::pub_with_shorthand, - clippy::redundant_closure_call, - clippy::single_call_fn - ) -)] +#![cfg_attr(include_nightly_lints, allow(clippy::absolute_paths, clippy::arc_with_non_send_sync))] // LINT-REPLACE-END // TODO deny clippy::same_name_method again once bitflags/bitflags#374 is merged #![allow(clippy::same_name_method, clippy::as_conversions, clippy::integer_division)] |