A new lint for shared code in if blocks

* Added expression check for shared_code_in_if_blocks
* Finishing touches for the shared_code_in_if_blocks lint
* Applying PR suggestions
* Update lints yay
* Moved test into subfolder
This commit is contained in:
xFrednet
2020-12-11 22:29:53 +00:00
parent 232e2b79f2
commit d1df73228a
17 changed files with 780 additions and 207 deletions

View File

@@ -616,6 +616,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
&copies::IFS_SAME_COND,
&copies::IF_SAME_THEN_ELSE,
&copies::SAME_FUNCTIONS_IN_IF_CONDITION,
&copies::SHARED_CODE_IN_IF_BLOCKS,
&copy_iterator::COPY_ITERATOR,
&create_dir::CREATE_DIR,
&dbg_macro::DBG_MACRO,
@@ -1365,6 +1366,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&casts::PTR_AS_PTR),
LintId::of(&checked_conversions::CHECKED_CONVERSIONS),
LintId::of(&copies::SAME_FUNCTIONS_IN_IF_CONDITION),
LintId::of(&copies::SHARED_CODE_IN_IF_BLOCKS),
LintId::of(&copy_iterator::COPY_ITERATOR),
LintId::of(&default::DEFAULT_TRAIT_ACCESS),
LintId::of(&dereference::EXPLICIT_DEREF_METHODS),