Skip to content

Commit f6ebd92

Browse files
committed
update clippy rules that could be machine applicable, however there are not many such warnings
1 parent 5054e7d commit f6ebd92

File tree

1 file changed

+158
-0
lines changed

1 file changed

+158
-0
lines changed

src/main.rs

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ fn count(map: BTreeMap<String, Vec<Warning>>) -> usize
405405

406406
fn clippy_fix() -> usize
407407
{
408+
std::env::set_var("__CARGO_FIX_YOLO", "1");
408409
let folder = get_folder();
409410
let manifest = format!("{folder}/Cargo.toml");
410411
let args = vec![
@@ -501,6 +502,163 @@ fn get_flags() -> Vec<String> {
501502
"disallowed_methods".to_string(),
502503
"disallowed_script_idents".to_string(),
503504
"disallowed_types".to_string(),
505+
/*
506+
// all clippy rules that are either inplaceholder or machine applicable
507+
"assertions_on_result_states".to_string(),
508+
"bind_instead_of_map".to_string(),
509+
"blocks_in_if_conditions".to_string(),
510+
"bool_to_int_with_if".to_string(),
511+
"borrow_as_ptr".to_string(),
512+
"borrow_deref_ref".to_string(),
513+
"borrowed_box".to_string(),
514+
"box_default".to_string(),
515+
"bytes_count_to_len".to_string(),
516+
"bytes_nth".to_string(),
517+
"cast_abs_to_unsigned".to_string(),
518+
"cast_lossless".to_string(),
519+
"cast_slice_different_sizes".to_string(),
520+
"cast_slice_from_raw_parts".to_string(),
521+
"char_lit_as_u8".to_string(),
522+
"cloned_instead_of_copied".to_string(),
523+
"clone_on_copy".to_string(),
524+
"collapsible_if".to_string(),
525+
"collapsible_str_replace".to_string(),
526+
"crate_in_macro_def".to_string(),
527+
"dbg_macro".to_string(),
528+
"default_instead_of_iter_empty".to_string(),
529+
"derivable_impls".to_string(),
530+
"equatable_if_let".to_string(),
531+
"err_expect".to_string(),
532+
"expect_fun_call".to_string(),
533+
"explicit_into_iter_loop".to_string(),
534+
"explicit_iter_loop".to_string(),
535+
"explicit_write".to_string(),
536+
"extend_with_drain".to_string(),
537+
"filter_map_identity".to_string(),
538+
"filter_map_next".to_string(),
539+
"filter_next".to_string(),
540+
"flat_map_identity".to_string(),
541+
"flat_map_option".to_string(),
542+
"from_over_into".to_string(),
543+
"from_str_radix_10".to_string(),
544+
"get_last_with_len".to_string(),
545+
"get_unwrap".to_string(),
546+
"implicit_clone".to_string(),
547+
"implicit_return".to_string(),
548+
"implicit_saturating_add".to_string(),
549+
"implicit_saturating_sub".to_string(),
550+
"inconsistent_struct_constructor".to_string(),
551+
"inefficient_to_string".to_string(),
552+
"infallible_destructuring_match".to_string(),
553+
"init_numbered_fields".to_string(),
554+
"inline_fn_without_body".to_string(),
555+
"into_iter_on_ref".to_string(),
556+
"int_plus_one".to_string(),
557+
"is_digit_ascii_radix".to_string(),
558+
"iter_cloned_collect".to_string(),
559+
"iter_count".to_string(),
560+
"iter_kv_map".to_string(),
561+
"iter_next_slice".to_string(),
562+
"iter_nth_zero".to_string(),
563+
"iter_overeager_cloned".to_string(),
564+
"iter_skip_next".to_string(),
565+
"large_const_arrays".to_string(),
566+
"len_zero".to_string(),
567+
"let_unit_value".to_string(),
568+
"manual_assert".to_string(),
569+
"manual_async_fn".to_string(),
570+
"manual_bits".to_string(),
571+
"manual_find".to_string(),
572+
"manual_is_ascii_check".to_string(),
573+
"manual_let_else".to_string(),
574+
"manual_ok_or".to_string(),
575+
"manual_rem_euclid".to_string(),
576+
"manual_retain".to_string(),
577+
"manual_saturating_arithmetic".to_string(),
578+
"manual_string_new".to_string(),
579+
"manual_str_repeat".to_string(),
580+
"manual_unwrap_or".to_string(),
581+
"map_clone".to_string(),
582+
"map_collect_result_unit".to_string(),
583+
"map_flatten".to_string(),
584+
"map_identity".to_string(),
585+
"map_unwrap_or".to_string(),
586+
"match_as_ref".to_string(),
587+
"match_bool".to_string(),
588+
"match_result_ok".to_string(),
589+
"match_single_binding".to_string(),
590+
"match_str_case_mismatch".to_string(),
591+
"missing_spin_loop".to_string(),
592+
"needless_arbitrary_self_type".to_string(),
593+
"needless_bool".to_string(),
594+
"needless_collect".to_string(),
595+
"needless_for_each".to_string(),
596+
"needless_late_init".to_string(),
597+
"needless_match".to_string(),
598+
"needless_option_as_deref".to_string(),
599+
"needless_option_take".to_string(),
600+
"needless_parens_on_range_literals".to_string(),
601+
"needless_question_mark".to_string(),
602+
"neg_multiply".to_string(),
603+
"no_effect".to_string(),
604+
"non_octal_unix_permissions".to_string(),
605+
"nonstandard_macro_braces".to_string(),
606+
"obfuscated_if_else".to_string(),
607+
"option_as_ref_deref".to_string(),
608+
"option_map_or_none".to_string(),
609+
"map_unwrap_or".to_string(),
610+
"or_fun_call".to_string(),
611+
"or_then_unwrap".to_string(),
612+
"partialeq_to_none".to_string(),
613+
"path_buf_push_overwrite".to_string(),
614+
"precedence".to_string(),
615+
"ptr_as_ptr".to_string(),
616+
"ptr_offset_with_cast".to_string(),
617+
"question_mark".to_string(),
618+
"rc_clone_in_vec_init".to_string(),
619+
"redundant_clone".to_string(),
620+
"redundant_closure_call".to_string(),
621+
"redundant_field_names".to_string(),
622+
"redundant_pattern".to_string(),
623+
"redundant_pub_crate".to_string(),
624+
"redundant_slicing".to_string(),
625+
"redundant_static_lifetimes".to_string(),
626+
"repeat_once".to_string(),
627+
"search_is_some".to_string(),
628+
"seek_from_current".to_string(),
629+
"seek_to_start_instead_of_rewind".to_string(),
630+
"single_char_pattern".to_string(),
631+
"single_component_path_imports".to_string(),
632+
"single_element_loop".to_string(),
633+
"single_match".to_string(),
634+
"stable_sort_primitive".to_string(),
635+
"strlen_on_c_strings".to_string(),
636+
"suspicious_operation_groupings".to_string(),
637+
"swap_ptr_to_ref".to_string(),
638+
"to_digit_is_some".to_string(),
639+
"transmute_ptr_to_ref".to_string(),
640+
"transmutes_expressible_as_ptr_casts".to_string(),
641+
"try_err".to_string(),
642+
"unit_arg".to_string(),
643+
"unnecessary_cast".to_string(),
644+
"unnecessary_fold".to_string(),
645+
"unnecessary_join".to_string(),
646+
"unnecessary_owned_empty_strings".to_string(),
647+
"unnecessary_sort_by".to_string(),
648+
"unnecessary_to_owned".to_string(),
649+
"unneeded_wildcard_pattern".to_string(),
650+
"unnested_or_patterns".to_string(),
651+
"unused_rounding".to_string(),
652+
"unused_unit".to_string(),
653+
"unwrap_or_else_default".to_string(),
654+
"useless_asref".to_string(),
655+
"use_self".to_string(),
656+
"vec_box".to_string(),
657+
"vec_init_then_push".to_string(),
658+
"while_let_loop".to_string(),
659+
"while_let_on_iterator".to_string(),
660+
"wildcard_imports".to_string(),
661+
*/
504662
];
505663
}
506664
flags

0 commit comments

Comments
 (0)