From 1406bc43e9ad5f65f66145c8b3dc6de61beb0132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ol=C4=99dzki?= Date: Sun, 29 Mar 2020 21:46:29 +0200 Subject: [PATCH] Adding InspectionTest as a superclass for all inspection tests --- .../com/sksamuel/scapegoat/InspectionTest.scala | 7 +++++++ .../sksamuel/scapegoat/inspections/AnyUseTest.scala | 7 ++----- .../scapegoat/inspections/AsInstanceOfTest.scala | 7 ++----- .../scapegoat/inspections/AvoidToMinusOneTest.scala | 7 ++----- .../inspections/ChainedPackageClauseTest.scala | 8 -------- .../scapegoat/inspections/ConstantIfTest.scala | 7 ++----- .../scapegoat/inspections/DoubleNegationTest.scala | 7 ++----- .../scapegoat/inspections/EitherGetTest.scala | 6 ++---- .../inspections/FinalModifierOnCaseClassTest.scala | 12 ++---------- .../inspections/FinalizerWithoutSuperTest.scala | 7 ++----- .../scapegoat/inspections/IsInstanceOfTest.scala | 7 ++----- .../inspections/LonelySealedTraitTest.scala | 7 ++----- .../scapegoat/inspections/MaxParameterTest.scala | 8 ++------ .../inspections/MethodReturningAnyTest.scala | 7 ++----- .../scapegoat/inspections/PublicFinalizerTest.scala | 7 ++----- .../RedundantFinalModifierOnMethodTest.scala | 11 ++--------- .../RedundantFinalModifierOnVarTest.scala | 11 ++--------- .../sksamuel/scapegoat/inspections/TryGetTest.scala | 6 ++---- .../scapegoat/inspections/TypeShadowingTest.scala | 7 ++----- .../scapegoat/inspections/VarClosureTest.scala | 7 ++----- .../scapegoat/inspections/VarCouldBeValTest.scala | 7 ++----- .../sksamuel/scapegoat/inspections/VarUseTest.scala | 8 ++------ .../inspections/VariableShadowingTest.scala | 7 ++----- .../scapegoat/inspections/WhileTrueTest.scala | 7 ++----- .../inspections/collections/ArrayEqualsTest.scala | 7 ++----- .../collections/AvoidSizeEqualsZeroTest.scala | 7 ++----- .../collections/AvoidSizeNotEqualsZeroTest.scala | 7 ++----- .../CollectionIndexOnNonIndexedSeqTest.scala | 11 ++--------- .../collections/CollectionNamingConfusionTest.scala | 11 ++--------- .../collections/CollectionNegativeIndexTest.scala | 11 ++--------- .../collections/CollectionPromotionToAnyTest.scala | 11 ++--------- .../collections/ComparisonToEmptyListTest.scala | 7 ++----- .../collections/ComparisonToEmptySetTest.scala | 7 ++----- .../collections/DuplicateMapKeyTest.scala | 7 ++----- .../collections/DuplicateSetValueTest.scala | 7 ++----- .../ExistsSimplifiableToContainsTest.scala | 11 ++--------- .../collections/FilterDotHeadOptionTest.scala | 7 ++----- .../inspections/collections/FilterDotHeadTest.scala | 7 ++----- .../collections/FilterDotIsEmptyTest.scala | 7 ++----- .../inspections/collections/FilterDotSizeTest.scala | 6 ++---- .../collections/FilterOptionAndGetTest.scala | 6 ++---- .../FindAndNotEqualsNoneReplaceWithExistsTest.scala | 11 ++--------- .../collections/FindDotIsDefinedTest.scala | 6 ++---- .../collections/JavaConversionsUseTest.scala | 6 ++---- .../inspections/collections/ListAppendTest.scala | 7 ++----- .../inspections/collections/ListSizeTest.scala | 7 ++----- .../collections/MapGetAndGetOrElseTest.scala | 8 ++------ .../collections/NegationIsEmptyTest.scala | 7 ++----- .../collections/NegationNonEmptyTest.scala | 7 ++----- .../inspections/collections/NegativeSeqPadTest.scala | 7 ++----- .../collections/PredefIterableIsMutableTest.scala | 11 ++--------- .../collections/PredefSeqIsMutableTest.scala | 7 ++----- .../collections/PredefTraversableIsMutableTest.scala | 11 ++--------- .../inspections/collections/PreferMapEmptyTest.scala | 8 ++------ .../inspections/collections/PreferSeqEmptyTest.scala | 7 ++----- .../inspections/collections/PreferSetEmptyTest.scala | 7 ++----- .../inspections/collections/ReverseFuncTest.scala | 8 ++------ .../collections/ReverseTailReverseTest.scala | 8 ++------ .../collections/ReverseTakeReverseTest.scala | 8 ++------ .../inspections/collections/SwapSortFilterTest.scala | 7 ++----- .../inspections/collections/UnsafeContainsTest.scala | 7 ++----- .../collections/UnsafeTraversableMethodsTest.scala | 12 ++---------- .../controlflow/RepeatedIfElseBodyTest.scala | 8 ++------ .../inspections/empty/EmptyCaseClassTest.scala | 7 ++----- .../scapegoat/inspections/empty/EmptyForTest.scala | 7 ++----- .../inspections/empty/EmptyIfBlockTest.scala | 7 ++----- .../inspections/empty/EmptyMethodTest.scala | 7 ++----- .../empty/EmptySynchronizedBlockTest.scala | 6 ++---- .../inspections/empty/EmptyTryBlockTest.scala | 7 ++----- .../inspections/empty/EmptyWhileBlockTest.scala | 7 ++----- .../inspections/empty/RedundantFinalizerTest.scala | 6 ++---- .../equality/ComparingFloatingPointTypesTest.scala | 11 ++--------- .../equality/ComparingUnrelatedTypesTest.scala | 11 ++--------- .../equality/ComparisonWithSelfInspectionTest.scala | 6 ++---- .../inspections/exception/CatchExceptionTest.scala | 7 ++----- .../inspections/exception/CatchFatalTest.scala | 7 ++----- .../inspections/exception/CatchNpeTest.scala | 7 ++----- .../inspections/exception/CatchThrowableTest.scala | 7 ++----- .../exception/IncorrectlyNamedExceptionsTest.scala | 11 ++--------- .../exception/SwallowedExceptionTest.scala | 7 ++----- .../inspections/exception/UnreachableCatchTest.scala | 7 ++----- .../inspections/imports/DuplicateImportTest.scala | 7 ++----- .../inspections/imports/WildcardImportTest.scala | 7 ++----- .../inferrence/BoundedByFinalTypeTest.scala | 7 ++----- .../inferrence/PointlessTypeBoundsTest.scala | 7 ++----- .../ProductWithSerializableInferredTest.scala | 6 ++---- .../matching/PartialFunctionInsteadOfMatchTest.scala | 11 ++--------- .../inspections/matching/RepeatedCaseBodyTest.scala | 7 ++----- .../matching/SuspiciousMatchOnClassObjectTest.scala | 12 ++---------- .../math/BigDecimalDoubleConstructorTest.scala | 11 ++--------- .../BigDecimalScaleWithoutRoundingModeTest.scala | 12 ++---------- .../inspections/math/BrokenOddnessTest.scala | 6 ++---- .../scapegoat/inspections/math/DivideByOneTest.scala | 8 ++------ .../scapegoat/inspections/math/ModOneTest.scala | 6 ++---- .../inspections/math/NanComparisonTest.scala | 8 ++------ .../scapegoat/inspections/math/UseCbrtTest.scala | 6 ++---- .../scapegoat/inspections/math/UseLog1PTest.scala | 7 ++----- .../scapegoat/inspections/math/UseSqrtTest.scala | 7 ++----- .../inspections/math/ZeroNumeratorTest.scala | 8 ++------ .../scapegoat/inspections/names/ClassNamesTest.scala | 7 ++----- .../inspections/names/MethodNamesTest.scala | 7 ++----- .../inspections/names/ObjectNamesTest.scala | 7 ++----- .../inspections/nulls/NullAssignmentTest.scala | 7 ++----- .../inspections/nulls/NullParameterTest.scala | 7 ++----- .../option/ImpossibleOptionSizeConditionTest.scala | 11 ++--------- .../scapegoat/inspections/option/OptionGetTest.scala | 6 ++---- .../inspections/option/OptionSizeTest.scala | 6 ++---- .../inspections/string/ArraysInFormatTest.scala | 7 ++----- .../inspections/string/ArraysToStringTest.scala | 7 ++----- .../string/EmptyInterpolatedStringTest.scala | 11 ++--------- .../inspections/string/IllegalFormatStringTest.scala | 7 ++----- .../string/IncorrectNumberOfArgsToFormatTest.scala | 11 ++--------- .../inspections/string/InvalidRegexTest.scala | 7 ++----- .../string/LooksLikeInterpolatedStringTest.scala | 12 ++---------- .../inspections/string/StripMarginOnRegexTest.scala | 7 ++----- .../inspections/string/SubstringZeroTest.scala | 7 ++----- .../string/UnsafeStringContainsTest.scala | 7 ++----- .../style/AvoidOperatorOverloadTest.scala | 7 ++----- .../style/ParameterlessMethodReturnsUnitTest.scala | 11 ++--------- .../style/SimplifyBooleanExpressionTest.scala | 6 ++---- .../inspections/unnecessary/NoOpOverrideTest.scala | 7 ++----- .../unnecessary/UnnecessaryConversionTest.scala | 7 ++----- .../inspections/unnecessary/UnnecessaryIfTest.scala | 7 ++----- .../unnecessary/UnnecessaryReturnUseTest.scala | 6 ++---- .../unnecessary/UnusedMethodParameterTest.scala | 7 ++----- 125 files changed, 253 insertions(+), 718 deletions(-) create mode 100644 src/test/scala/com/sksamuel/scapegoat/InspectionTest.scala delete mode 100644 src/test/scala/com/sksamuel/scapegoat/inspections/ChainedPackageClauseTest.scala diff --git a/src/test/scala/com/sksamuel/scapegoat/InspectionTest.scala b/src/test/scala/com/sksamuel/scapegoat/InspectionTest.scala new file mode 100644 index 00000000..024d24fb --- /dev/null +++ b/src/test/scala/com/sksamuel/scapegoat/InspectionTest.scala @@ -0,0 +1,7 @@ +package com.sksamuel.scapegoat + +import org.scalatest.OneInstancePerTest +import org.scalatest.freespec.AnyFreeSpec +import org.scalatest.matchers.should.Matchers + +abstract class InspectionTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest {} diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/AnyUseTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/AnyUseTest.scala index 1676e1a5..4c77c5aa 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/AnyUseTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/AnyUseTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class AnyUseTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class AnyUseTest extends InspectionTest { override val inspections = Seq(new AnyUse) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/AsInstanceOfTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/AsInstanceOfTest.scala index 585904a2..a4602169 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/AsInstanceOfTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/AsInstanceOfTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers -class AsInstanceOfTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class AsInstanceOfTest extends InspectionTest { override val inspections = Seq(new AsInstanceOf) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/AvoidToMinusOneTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/AvoidToMinusOneTest.scala index 165890b8..564f326a 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/AvoidToMinusOneTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/AvoidToMinusOneTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class AvoidToMinusOneTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class AvoidToMinusOneTest extends InspectionTest { override val inspections = Seq(new AvoidToMinusOne) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/ChainedPackageClauseTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/ChainedPackageClauseTest.scala deleted file mode 100644 index 194096ee..00000000 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/ChainedPackageClauseTest.scala +++ /dev/null @@ -1,8 +0,0 @@ -package com.sksamuel.scapegoat.inspections - -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -/** @author Stephen Samuel */ -class ChainedPackageClauseTest extends AnyFreeSpec with Matchers with OneInstancePerTest {} diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/ConstantIfTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/ConstantIfTest.scala index cd7cbf5c..14312116 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/ConstantIfTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/ConstantIfTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.unneccesary.ConstantIf -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class ConstantIfTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class ConstantIfTest extends InspectionTest { override val inspections = Seq(new ConstantIf) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/DoubleNegationTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/DoubleNegationTest.scala index 5fb3dfb6..33a13392 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/DoubleNegationTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/DoubleNegationTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class DoubleNegationTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class DoubleNegationTest extends InspectionTest { override val inspections = Seq(new DoubleNegation) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/EitherGetTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/EitherGetTest.scala index ef92d291..0bbdbb69 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/EitherGetTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/EitherGetTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.option.EitherGet -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers -class EitherGetTest extends AnyFreeSpec with Matchers with PluginRunner { +class EitherGetTest extends InspectionTest { override val inspections = Seq(new EitherGet) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClassTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClassTest.scala index 34dbb707..89457a77 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClassTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClassTest.scala @@ -1,15 +1,7 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class FinalModifierOnCaseClassTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class FinalModifierOnCaseClassTest extends InspectionTest { override val inspections = Seq(new FinalModifierOnCaseClass) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/FinalizerWithoutSuperTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/FinalizerWithoutSuperTest.scala index b66381d7..1cf7a8c7 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/FinalizerWithoutSuperTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/FinalizerWithoutSuperTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.unsafe.FinalizerWithoutSuper -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class FinalizerWithoutSuperTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class FinalizerWithoutSuperTest extends InspectionTest { override val inspections = Seq(new FinalizerWithoutSuper) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/IsInstanceOfTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/IsInstanceOfTest.scala index fdefe308..7b026d13 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/IsInstanceOfTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/IsInstanceOfTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.unsafe.IsInstanceOf -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class IsInstanceOfTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class IsInstanceOfTest extends InspectionTest { override val inspections = Seq(new IsInstanceOf) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/LonelySealedTraitTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/LonelySealedTraitTest.scala index 740fb83a..c99e3181 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/LonelySealedTraitTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/LonelySealedTraitTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class LonelySealedTraitTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class LonelySealedTraitTest extends InspectionTest { override val inspections = Seq(new LonelySealedTrait) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/MaxParameterTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/MaxParameterTest.scala index 68106fa5..c3910d75 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/MaxParameterTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/MaxParameterTest.scala @@ -1,11 +1,7 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class MaxParameterTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class MaxParameterTest extends InspectionTest { override val inspections = Seq(new MaxParameters) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/MethodReturningAnyTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/MethodReturningAnyTest.scala index 4b9b9d9e..21d9b7bb 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/MethodReturningAnyTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/MethodReturningAnyTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.inference.MethodReturningAny -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class MethodReturningAnyTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class MethodReturningAnyTest extends InspectionTest { override val inspections = Seq(new MethodReturningAny) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/PublicFinalizerTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/PublicFinalizerTest.scala index 33eb9ae4..9f0b264f 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/PublicFinalizerTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/PublicFinalizerTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class PublicFinalizerTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class PublicFinalizerTest extends InspectionTest { override val inspections = Seq(new PublicFinalizer) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethodTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethodTest.scala index af6ff2f0..1891a1f3 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethodTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethodTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class RedundantFinalModifierOnMethodTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class RedundantFinalModifierOnMethodTest extends InspectionTest { override val inspections = Seq(new RedundantFinalModifierOnMethod) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVarTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVarTest.scala index c561240a..4c23a930 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVarTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVarTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class RedundantFinalModifierOnVarTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class RedundantFinalModifierOnVarTest extends InspectionTest { override val inspections = Seq(new RedundantFinalModifierOnVar) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/TryGetTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/TryGetTest.scala index c7438f7e..ff9a9e56 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/TryGetTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/TryGetTest.scala @@ -1,12 +1,10 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.unsafe.TryGet -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class TryGetTest extends AnyFreeSpec with PluginRunner with Matchers { +class TryGetTest extends InspectionTest { override val inspections = Seq(new TryGet) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/TypeShadowingTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/TypeShadowingTest.scala index 37961182..72c9c852 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/TypeShadowingTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/TypeShadowingTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class TypeShadowingTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class TypeShadowingTest extends InspectionTest { override val inspections = Seq(new TypeShadowing) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/VarClosureTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/VarClosureTest.scala index 7897b426..262a7a9e 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/VarClosureTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/VarClosureTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class VarClosureTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class VarClosureTest extends InspectionTest { override val inspections = Seq(new VarClosure) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/VarCouldBeValTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/VarCouldBeValTest.scala index 0e331718..37b0a221 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/VarCouldBeValTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/VarCouldBeValTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.unneccesary.VarCouldBeVal -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers -class VarCouldBeValTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class VarCouldBeValTest extends InspectionTest { override val inspections = Seq(new VarCouldBeVal) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/VarUseTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/VarUseTest.scala index fc7c95dc..a8330dcf 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/VarUseTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/VarUseTest.scala @@ -1,11 +1,7 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class VarUseTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class VarUseTest extends InspectionTest { override val inspections = Seq(new VarUse) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/VariableShadowingTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/VariableShadowingTest.scala index 9b7f1cc6..83727111 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/VariableShadowingTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/VariableShadowingTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class VariableShadowingTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class VariableShadowingTest extends InspectionTest { override val inspections = Seq(new VariableShadowing) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/WhileTrueTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/WhileTrueTest.scala index f0b16cfe..044c6c22 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/WhileTrueTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/WhileTrueTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.controlflow.WhileTrue -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class WhileTrueTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class WhileTrueTest extends InspectionTest { override val inspections = Seq(new WhileTrue) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ArrayEqualsTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ArrayEqualsTest.scala index 31400df7..1aa28aa2 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ArrayEqualsTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ArrayEqualsTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ArrayEqualsTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class ArrayEqualsTest extends InspectionTest { override val inspections = Seq(new ArrayEquals) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeEqualsZeroTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeEqualsZeroTest.scala index 60d8db85..eb040a37 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeEqualsZeroTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeEqualsZeroTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class AvoidSizeEqualsZeroTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class AvoidSizeEqualsZeroTest extends InspectionTest { override val inspections = Seq(new AvoidSizeEqualsZero) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeNotEqualsZeroTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeNotEqualsZeroTest.scala index b39f9a5f..4691763e 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeNotEqualsZeroTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeNotEqualsZeroTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class AvoidSizeNotEqualsZeroTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class AvoidSizeNotEqualsZeroTest extends InspectionTest { override val inspections = Seq(new AvoidSizeNotEqualsZero) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionIndexOnNonIndexedSeqTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionIndexOnNonIndexedSeqTest.scala index 6b1c62c5..91c66592 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionIndexOnNonIndexedSeqTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionIndexOnNonIndexedSeqTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Josh Rosen */ -class CollectionIndexOnNonIndexedSeqTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class CollectionIndexOnNonIndexedSeqTest extends InspectionTest { override val inspections = Seq(new CollectionIndexOnNonIndexedSeq) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNamingConfusionTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNamingConfusionTest.scala index 278cb214..50671a28 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNamingConfusionTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNamingConfusionTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class CollectionNamingConfusionTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class CollectionNamingConfusionTest extends InspectionTest { override val inspections = Seq(new CollectionNamingConfusion) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNegativeIndexTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNegativeIndexTest.scala index 8cd80ce8..beedeec1 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNegativeIndexTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNegativeIndexTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class CollectionNegativeIndexTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class CollectionNegativeIndexTest extends InspectionTest { override val inspections = Seq(new CollectionNegativeIndex) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionPromotionToAnyTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionPromotionToAnyTest.scala index 5ff17fd7..64d5f2d2 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionPromotionToAnyTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionPromotionToAnyTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class CollectionPromotionToAnyTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class CollectionPromotionToAnyTest extends InspectionTest { override val inspections = Seq(new CollectionPromotionToAny) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptyListTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptyListTest.scala index 68a69a99..2014c122 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptyListTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptyListTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ComparisonToEmptyListTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class ComparisonToEmptyListTest extends InspectionTest { override val inspections = Seq(new ComparisonToEmptyList) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptySetTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptySetTest.scala index c7a0a34c..af4143d2 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptySetTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptySetTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ComparisonToEmptySetTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class ComparisonToEmptySetTest extends InspectionTest { override val inspections = Seq(new ComparisonToEmptySet) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateMapKeyTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateMapKeyTest.scala index f402c6e7..3fbbaca0 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateMapKeyTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateMapKeyTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class DuplicateMapKeyTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class DuplicateMapKeyTest extends InspectionTest { override val inspections = Seq(new DuplicateMapKey) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateSetValueTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateSetValueTest.scala index e5959c03..9d7460db 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateSetValueTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateSetValueTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class DuplicateSetValueTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class DuplicateSetValueTest extends InspectionTest { override val inspections = Seq(new DuplicateSetValue) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ExistsSimplifiableToContainsTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ExistsSimplifiableToContainsTest.scala index f03a5d1e..4899cfd5 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ExistsSimplifiableToContainsTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ExistsSimplifiableToContainsTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ExistsSimplifiableToContainsTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class ExistsSimplifiableToContainsTest extends InspectionTest { override val inspections = Seq(new ExistsSimplifiableToContains) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadOptionTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadOptionTest.scala index e35850a2..f743be2a 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadOptionTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadOptionTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class FilterDotHeadOptionTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class FilterDotHeadOptionTest extends InspectionTest { override val inspections = Seq(new FilterDotHeadOption) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadTest.scala index 40e7d474..279bb8fc 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class FilterDotHeadTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class FilterDotHeadTest extends InspectionTest { override val inspections = Seq(new FilterDotHead) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotIsEmptyTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotIsEmptyTest.scala index 47d0a8f1..460abeac 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotIsEmptyTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotIsEmptyTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class FilterDotIsEmptyTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class FilterDotIsEmptyTest extends InspectionTest { override val inspections = Seq(new FilterDotIsEmpty) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotSizeTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotSizeTest.scala index 1fcfa0a5..8646f7db 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotSizeTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotSizeTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class FilterDotSizeTest extends AnyFreeSpec with Matchers with PluginRunner { +class FilterDotSizeTest extends InspectionTest { override val inspections = Seq(new FilterDotSize) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterOptionAndGetTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterOptionAndGetTest.scala index 529d6a08..d5d2112f 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterOptionAndGetTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterOptionAndGetTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class FilterOptionAndGetTest extends AnyFreeSpec with Matchers with PluginRunner { +class FilterOptionAndGetTest extends InspectionTest { override val inspections = Seq(new FilterOptionAndGet) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExistsTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExistsTest.scala index 0d7958a4..c031e2da 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExistsTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExistsTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class FindAndNotEqualsNoneReplaceWithExistsTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class FindAndNotEqualsNoneReplaceWithExistsTest extends InspectionTest { override val inspections = Seq(new FindAndNotEqualsNoneReplaceWithExists) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FindDotIsDefinedTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FindDotIsDefinedTest.scala index c11b2c56..127aa058 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FindDotIsDefinedTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FindDotIsDefinedTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class FindDotIsDefinedTest extends AnyFreeSpec with Matchers with PluginRunner { +class FindDotIsDefinedTest extends InspectionTest { override val inspections = Seq(new FindDotIsDefined) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/JavaConversionsUseTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/JavaConversionsUseTest.scala index 51d2474a..8397fd44 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/JavaConversionsUseTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/JavaConversionsUseTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.{isScala213, PluginRunner} -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.{isScala213, InspectionTest} /** @author Stephen Samuel */ -class JavaConversionsUseTest extends AnyFreeSpec with Matchers with PluginRunner { +class JavaConversionsUseTest extends InspectionTest { override val inspections = Seq(new JavaConversionsUse) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ListAppendTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ListAppendTest.scala index 1350b7bd..edad5658 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ListAppendTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ListAppendTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ListAppendTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class ListAppendTest extends InspectionTest { override val inspections = Seq(new ListAppend) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ListSizeTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ListSizeTest.scala index 0576acd6..ef35b787 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ListSizeTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ListSizeTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ListSizeTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class ListSizeTest extends InspectionTest { override val inspections = Seq(new ListSize) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/MapGetAndGetOrElseTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/MapGetAndGetOrElseTest.scala index 8b163ab5..682a26f1 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/MapGetAndGetOrElseTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/MapGetAndGetOrElseTest.scala @@ -1,11 +1,7 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class MapGetAndGetOrElseTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class MapGetAndGetOrElseTest extends InspectionTest { override val inspections = Seq(new MapGetAndGetOrElse) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegationIsEmptyTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegationIsEmptyTest.scala index c89cc6dc..22378f2d 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegationIsEmptyTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegationIsEmptyTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class NegationIsEmptyTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class NegationIsEmptyTest extends InspectionTest { override val inspections = Seq(new NegationIsEmpty) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegationNonEmptyTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegationNonEmptyTest.scala index 10e00b76..4c23fefa 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegationNonEmptyTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegationNonEmptyTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class NegationNonEmptyTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class NegationNonEmptyTest extends InspectionTest { override val inspections = Seq(new NegationNonEmpty) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegativeSeqPadTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegativeSeqPadTest.scala index dd5ea792..243c924b 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegativeSeqPadTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegativeSeqPadTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class NegativeSeqPadTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class NegativeSeqPadTest extends InspectionTest { override val inspections = Seq(new NegativeSeqPad) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefIterableIsMutableTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefIterableIsMutableTest.scala index 7eea9e1d..e3f9b5e1 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefIterableIsMutableTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefIterableIsMutableTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class PredefIterableIsMutableTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class PredefIterableIsMutableTest extends InspectionTest { override val inspections = Seq(new PredefIterableIsMutable) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefSeqIsMutableTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefSeqIsMutableTest.scala index 14b23aa8..a10b1cbd 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefSeqIsMutableTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefSeqIsMutableTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.{isScala213, PluginRunner} -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.{isScala213, InspectionTest} /** @author Stephen Samuel */ -class PredefSeqIsMutableTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class PredefSeqIsMutableTest extends InspectionTest { override val inspections = Seq(new PredefSeqIsMutable) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefTraversableIsMutableTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefTraversableIsMutableTest.scala index fdd57eb6..4a98ef68 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefTraversableIsMutableTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefTraversableIsMutableTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.{isScala213, PluginRunner} -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.{isScala213, InspectionTest} /** @author Stephen Samuel */ -class PredefTraversableIsMutableTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class PredefTraversableIsMutableTest extends InspectionTest { override val inspections = Seq(new PredefTraversableIsMutable) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmptyTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmptyTest.scala index 7d0943b7..fae219dc 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmptyTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmptyTest.scala @@ -1,11 +1,7 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class PreferMapEmptyTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class PreferMapEmptyTest extends InspectionTest { override val inspections = Seq(new PreferMapEmpty) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferSeqEmptyTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferSeqEmptyTest.scala index eaab5d0b..e6d9e033 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferSeqEmptyTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferSeqEmptyTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class PreferSeqEmptyTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class PreferSeqEmptyTest extends InspectionTest { override val inspections = Seq(new PreferSeqEmpty) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferSetEmptyTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferSetEmptyTest.scala index ec08a2ca..c2aad784 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferSetEmptyTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferSetEmptyTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class PreferSetEmptyTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class PreferSetEmptyTest extends InspectionTest { override val inspections = Seq(new PreferSetEmpty) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseFuncTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseFuncTest.scala index c76e28a0..8c4f1b5b 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseFuncTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseFuncTest.scala @@ -1,11 +1,7 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class ReverseFuncTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class ReverseFuncTest extends InspectionTest { override val inspections = Seq(new ReverseFunc) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTailReverseTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTailReverseTest.scala index fcf5dd44..44719561 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTailReverseTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTailReverseTest.scala @@ -1,11 +1,7 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class ReverseTailReverseTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class ReverseTailReverseTest extends InspectionTest { override val inspections = Seq(new ReverseTailReverse) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTakeReverseTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTakeReverseTest.scala index 67141b5d..772877c1 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTakeReverseTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTakeReverseTest.scala @@ -1,11 +1,7 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class ReverseTakeReverseTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class ReverseTakeReverseTest extends InspectionTest { override val inspections = Seq(new ReverseTakeReverse) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/SwapSortFilterTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/SwapSortFilterTest.scala index d3d05b46..86411292 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/SwapSortFilterTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/SwapSortFilterTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class SwapSortFilterTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class SwapSortFilterTest extends InspectionTest { override val inspections = Seq(new SwapSortFilter) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeContainsTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeContainsTest.scala index 8a168516..4235a4ba 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeContainsTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeContainsTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class UnsafeContainsTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class UnsafeContainsTest extends InspectionTest { override val inspections = Seq(new UnsafeContains) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeTraversableMethodsTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeTraversableMethodsTest.scala index 32d8c999..f277c44c 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeTraversableMethodsTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeTraversableMethodsTest.scala @@ -1,15 +1,7 @@ package com.sksamuel.scapegoat.inspections.collections -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class UnsafeTraversableMethodsTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class UnsafeTraversableMethodsTest extends InspectionTest { override val inspections = Seq(new UnsafeTraversableMethods) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBodyTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBodyTest.scala index 18e8f529..8e1133c7 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBodyTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBodyTest.scala @@ -1,11 +1,7 @@ package com.sksamuel.scapegoat.inspections.controlflow -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class RepeatedIfElseBodyTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class RepeatedIfElseBodyTest extends InspectionTest { override val inspections = Seq(new RepeatedIfElseBody) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyCaseClassTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyCaseClassTest.scala index a3ed4c44..706334a5 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyCaseClassTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyCaseClassTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections.empty -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.EmptyCaseClass -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class EmptyCaseClassTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class EmptyCaseClassTest extends InspectionTest { override val inspections = Seq(new EmptyCaseClass) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyForTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyForTest.scala index d5fcb737..5b40983d 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyForTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyForTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.empty -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class EmptyForTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class EmptyForTest extends InspectionTest { override val inspections = Seq(new EmptyFor) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyIfBlockTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyIfBlockTest.scala index 39f98eb3..c02b4eda 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyIfBlockTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyIfBlockTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.empty -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class EmptyIfBlockTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class EmptyIfBlockTest extends InspectionTest { override val inspections = Seq(new EmptyIfBlock) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyMethodTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyMethodTest.scala index 05ec3a5f..64bc9dc8 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyMethodTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyMethodTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.empty -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class EmptyMethodTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class EmptyMethodTest extends InspectionTest { override val inspections = Seq(new EmptyMethod) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptySynchronizedBlockTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptySynchronizedBlockTest.scala index f42493f4..c54d287f 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptySynchronizedBlockTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptySynchronizedBlockTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections.empty -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class EmptySynchronizedBlockTest extends AnyFreeSpec with Matchers with PluginRunner { +class EmptySynchronizedBlockTest extends InspectionTest { override val inspections = Seq(new EmptySynchronizedBlock) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyTryBlockTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyTryBlockTest.scala index 0d33a8bd..ec0c9251 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyTryBlockTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyTryBlockTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.empty -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class EmptyTryBlockTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class EmptyTryBlockTest extends InspectionTest { override val inspections = Seq(new EmptyTryBlock) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyWhileBlockTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyWhileBlockTest.scala index cdec13fe..e5a56190 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyWhileBlockTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyWhileBlockTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.empty -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class EmptyWhileBlockTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class EmptyWhileBlockTest extends InspectionTest { override val inspections = Seq(new EmptyWhileBlock) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/RedundantFinalizerTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/RedundantFinalizerTest.scala index 99d1534d..a9c9ef68 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/RedundantFinalizerTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/RedundantFinalizerTest.scala @@ -1,12 +1,10 @@ package com.sksamuel.scapegoat.inspections.empty -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.unneccesary.RedundantFinalizer -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class RedundantFinalizerTest extends AnyFreeSpec with Matchers with PluginRunner { +class RedundantFinalizerTest extends InspectionTest { override val inspections = Seq(new RedundantFinalizer) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparingFloatingPointTypesTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparingFloatingPointTypesTest.scala index 108cd615..9ce35073 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparingFloatingPointTypesTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparingFloatingPointTypesTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.equality -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ComparingFloatingPointTypesTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class ComparingFloatingPointTypesTest extends InspectionTest { override val inspections = Seq(new ComparingFloatingPointTypes) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparingUnrelatedTypesTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparingUnrelatedTypesTest.scala index b7655dfa..6d4e9b73 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparingUnrelatedTypesTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparingUnrelatedTypesTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.equality -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ComparingUnrelatedTypesTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class ComparingUnrelatedTypesTest extends InspectionTest { override val inspections = Seq(new ComparingUnrelatedTypes) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparisonWithSelfInspectionTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparisonWithSelfInspectionTest.scala index 1f2e3ef6..cb202fe3 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparisonWithSelfInspectionTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparisonWithSelfInspectionTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections.equality -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ComparisonWithSelfInspectionTest extends AnyFreeSpec with Matchers with PluginRunner { +class ComparisonWithSelfInspectionTest extends InspectionTest { override val inspections = Seq(new ComparisonWithSelf) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionTest.scala index 21f9da51..1d1aba3e 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.exception -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Marconi Lanna */ -class CatchExceptionTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class CatchExceptionTest extends InspectionTest { override val inspections = Seq(new CatchException) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchFatalTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchFatalTest.scala index d57a1cc6..2cc80878 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchFatalTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchFatalTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.exception -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Marconi Lanna */ -class CatchFatalTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class CatchFatalTest extends InspectionTest { override val inspections = Seq(new CatchFatal) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchNpeTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchNpeTest.scala index 31af3bc3..090b6874 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchNpeTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchNpeTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.exception -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class CatchNpeTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class CatchNpeTest extends InspectionTest { override val inspections = Seq(new CatchNpe) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchThrowableTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchThrowableTest.scala index 6166c2c3..90c8fbd0 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchThrowableTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchThrowableTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.exception -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class CatchThrowableTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class CatchThrowableTest extends InspectionTest { override val inspections = Seq(new CatchThrowable) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/IncorrectlyNamedExceptionsTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/IncorrectlyNamedExceptionsTest.scala index b2075ec1..46983e13 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/IncorrectlyNamedExceptionsTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/IncorrectlyNamedExceptionsTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.exception -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class IncorrectlyNamedExceptionsTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class IncorrectlyNamedExceptionsTest extends InspectionTest { override val inspections = Seq(new IncorrectlyNamedExceptions) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/SwallowedExceptionTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/SwallowedExceptionTest.scala index 9d69dc23..2d057816 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/SwallowedExceptionTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/SwallowedExceptionTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.exception -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class SwallowedExceptionTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class SwallowedExceptionTest extends InspectionTest { override val inspections = Seq(new SwallowedException) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/UnreachableCatchTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/UnreachableCatchTest.scala index 517f1f03..63a08d6b 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/UnreachableCatchTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/UnreachableCatchTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.exception -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class UnreachableCatchTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class UnreachableCatchTest extends InspectionTest { override val inspections = Seq(new UnreachableCatch) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/imports/DuplicateImportTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/imports/DuplicateImportTest.scala index 846fa4a2..86094e80 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/imports/DuplicateImportTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/imports/DuplicateImportTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.imports -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class DuplicateImportTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class DuplicateImportTest extends InspectionTest { override val inspections = Seq(new DuplicateImport) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/imports/WildcardImportTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/imports/WildcardImportTest.scala index f0739e50..6178bd59 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/imports/WildcardImportTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/imports/WildcardImportTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.imports -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class WildcardImportTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class WildcardImportTest extends InspectionTest { override val inspections = Seq(new WildcardImport) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/BoundedByFinalTypeTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/BoundedByFinalTypeTest.scala index ec451fae..172b9acb 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/BoundedByFinalTypeTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/BoundedByFinalTypeTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections.inferrence -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.inference.BoundedByFinalType -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class BoundedByFinalTypeTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class BoundedByFinalTypeTest extends InspectionTest { override val inspections = Seq(new BoundedByFinalType) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/PointlessTypeBoundsTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/PointlessTypeBoundsTest.scala index a21ac77a..fecf251a 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/PointlessTypeBoundsTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/PointlessTypeBoundsTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections.inferrence -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.inference.PointlessTypeBounds -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class PointlessTypeBoundsTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class PointlessTypeBoundsTest extends InspectionTest { override val inspections = Seq(new PointlessTypeBounds) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/ProductWithSerializableInferredTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/ProductWithSerializableInferredTest.scala index 51a8debc..6cc00256 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/ProductWithSerializableInferredTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/ProductWithSerializableInferredTest.scala @@ -1,12 +1,10 @@ package com.sksamuel.scapegoat.inspections.inferrence -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.inference.ProductWithSerializableInferred -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class ProductWithSerializableInferredTest extends AnyFreeSpec with Matchers with PluginRunner { +class ProductWithSerializableInferredTest extends InspectionTest { override val inspections = Seq(new ProductWithSerializableInferred) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/matching/PartialFunctionInsteadOfMatchTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/matching/PartialFunctionInsteadOfMatchTest.scala index eb9b67e6..24c821ae 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/matching/PartialFunctionInsteadOfMatchTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/matching/PartialFunctionInsteadOfMatchTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.matching -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class PartialFunctionInsteadOfMatchTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class PartialFunctionInsteadOfMatchTest extends InspectionTest { override val inspections = Seq(new PartialFunctionInsteadOfMatch) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/matching/RepeatedCaseBodyTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/matching/RepeatedCaseBodyTest.scala index 23799fe5..98e8b30a 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/matching/RepeatedCaseBodyTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/matching/RepeatedCaseBodyTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.matching -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class RepeatedCaseBodyTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class RepeatedCaseBodyTest extends InspectionTest { override val inspections = Seq(new RepeatedCaseBody) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/matching/SuspiciousMatchOnClassObjectTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/matching/SuspiciousMatchOnClassObjectTest.scala index eb434976..993d7cbf 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/matching/SuspiciousMatchOnClassObjectTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/matching/SuspiciousMatchOnClassObjectTest.scala @@ -1,15 +1,7 @@ package com.sksamuel.scapegoat.inspections.matching -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class SuspiciousMatchOnClassObjectTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class SuspiciousMatchOnClassObjectTest extends InspectionTest { override val inspections = Seq(new SuspiciousMatchOnClassObject) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalDoubleConstructorTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalDoubleConstructorTest.scala index ad1ffa75..06146fb0 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalDoubleConstructorTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalDoubleConstructorTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.math -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class BigDecimalDoubleConstructorTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class BigDecimalDoubleConstructorTest extends InspectionTest { override val inspections = Seq(new BigDecimalDoubleConstructor) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalScaleWithoutRoundingModeTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalScaleWithoutRoundingModeTest.scala index 6b3ec4d8..5a6b4ef8 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalScaleWithoutRoundingModeTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalScaleWithoutRoundingModeTest.scala @@ -1,15 +1,7 @@ package com.sksamuel.scapegoat.inspections.math -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class BigDecimalScaleWithoutRoundingModeTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class BigDecimalScaleWithoutRoundingModeTest extends InspectionTest { override val inspections = Seq(new BigDecimalScaleWithoutRoundingMode) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/math/BrokenOddnessTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/math/BrokenOddnessTest.scala index cf3b08ad..2a98cde0 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/BrokenOddnessTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/BrokenOddnessTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections.math -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class BrokenOddnessTest extends AnyFreeSpec with Matchers with PluginRunner { +class BrokenOddnessTest extends InspectionTest { override val inspections = Seq(new BrokenOddness) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/math/DivideByOneTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/math/DivideByOneTest.scala index 926ce918..a01de8ff 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/DivideByOneTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/DivideByOneTest.scala @@ -1,11 +1,7 @@ package com.sksamuel.scapegoat.inspections.math -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class DivideByOneTest extends AnyFreeSpec with PluginRunner with Matchers with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class DivideByOneTest extends InspectionTest { override val inspections = Seq(new DivideByOne) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/math/ModOneTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/math/ModOneTest.scala index c35127b4..d786078b 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/ModOneTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/ModOneTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections.math -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ModOneTest extends AnyFreeSpec with PluginRunner with Matchers { +class ModOneTest extends InspectionTest { override val inspections = Seq(new ModOne) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/math/NanComparisonTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/math/NanComparisonTest.scala index b6ca7cb8..c32bd832 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/NanComparisonTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/NanComparisonTest.scala @@ -1,11 +1,7 @@ package com.sksamuel.scapegoat.inspections.math -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class NanComparisonTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class NanComparisonTest extends InspectionTest { override val inspections = Seq(new NanComparison) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseCbrtTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseCbrtTest.scala index 2fc5948b..df23c1a7 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseCbrtTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseCbrtTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections.math -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Matic Potočnik */ -class UseCbrtTest extends AnyFreeSpec with Matchers with PluginRunner { +class UseCbrtTest extends InspectionTest { override val inspections = Seq(new UseCbrt) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseLog1PTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseLog1PTest.scala index 8e1883fa..e7e48522 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseLog1PTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseLog1PTest.scala @@ -1,10 +1,7 @@ package com.sksamuel.scapegoat.inspections.math -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class UseLog1PTest extends AnyFreeSpec with Matchers with PluginRunner { +import com.sksamuel.scapegoat.InspectionTest +class UseLog1PTest extends InspectionTest { override val inspections = Seq(new UseLog1P) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseSqrtTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseSqrtTest.scala index 0246db8d..305fcbe1 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseSqrtTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseSqrtTest.scala @@ -1,10 +1,7 @@ package com.sksamuel.scapegoat.inspections.math -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class UseSqrtTest extends AnyFreeSpec with Matchers with PluginRunner { +import com.sksamuel.scapegoat.InspectionTest +class UseSqrtTest extends InspectionTest { override val inspections = Seq(new UseSqrt) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/math/ZeroNumeratorTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/math/ZeroNumeratorTest.scala index 6cc23a28..c6bbc5e3 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/ZeroNumeratorTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/ZeroNumeratorTest.scala @@ -1,11 +1,7 @@ package com.sksamuel.scapegoat.inspections.math -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class ZeroNumeratorTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class ZeroNumeratorTest extends InspectionTest { override val inspections = Seq(new ZeroNumerator) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/names/ClassNamesTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/names/ClassNamesTest.scala index d5eb5943..abc8b9c4 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/names/ClassNamesTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/names/ClassNamesTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections.names -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.naming.ClassNames -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class ClassNamesTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class ClassNamesTest extends InspectionTest { override val inspections = Seq(new ClassNames) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/names/MethodNamesTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/names/MethodNamesTest.scala index 14e2dad0..08ba4658 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/names/MethodNamesTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/names/MethodNamesTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections.names -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.naming.MethodNames -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class MethodNamesTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class MethodNamesTest extends InspectionTest { override val inspections = Seq(new MethodNames) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/names/ObjectNamesTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/names/ObjectNamesTest.scala index 79490cef..cccadc9b 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/names/ObjectNamesTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/names/ObjectNamesTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections.names -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.naming.ObjectNames -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class ObjectNamesTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class ObjectNamesTest extends InspectionTest { override val inspections = Seq(new ObjectNames) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/nulls/NullAssignmentTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/nulls/NullAssignmentTest.scala index f1edb8ff..0c15b159 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/nulls/NullAssignmentTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/nulls/NullAssignmentTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.nulls -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class NullAssignmentTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class NullAssignmentTest extends InspectionTest { override val inspections = Seq(new NullAssignment) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/nulls/NullParameterTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/nulls/NullParameterTest.scala index dc43031e..cdca2ab2 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/nulls/NullParameterTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/nulls/NullParameterTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.nulls -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class NullParameterTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class NullParameterTest extends InspectionTest { override val inspections = Seq(new NullParameter) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/option/ImpossibleOptionSizeConditionTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/option/ImpossibleOptionSizeConditionTest.scala index 69f48613..a921f03c 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/option/ImpossibleOptionSizeConditionTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/option/ImpossibleOptionSizeConditionTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.option -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ImpossibleOptionSizeConditionTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class ImpossibleOptionSizeConditionTest extends InspectionTest { override val inspections = Seq(new ImpossibleOptionSizeCondition) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/option/OptionGetTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/option/OptionGetTest.scala index 6a399e0b..839a7d1b 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/option/OptionGetTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/option/OptionGetTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections.option -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class OptionGetTest extends AnyFreeSpec with Matchers with PluginRunner { +class OptionGetTest extends InspectionTest { override val inspections = Seq(new OptionGet) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/option/OptionSizeTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/option/OptionSizeTest.scala index 2490f1ff..de446aad 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/option/OptionSizeTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/option/OptionSizeTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections.option -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class OptionSizeTest extends AnyFreeSpec with Matchers with PluginRunner { +class OptionSizeTest extends InspectionTest { override val inspections = Seq(new OptionSize) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/string/ArraysInFormatTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/string/ArraysInFormatTest.scala index 1630ae5e..55dcefac 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/ArraysInFormatTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/ArraysInFormatTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.string -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ArraysInFormatTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class ArraysInFormatTest extends InspectionTest { override val inspections = Seq(new ArraysInFormat) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/string/ArraysToStringTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/string/ArraysToStringTest.scala index d335ac9b..8d755cdd 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/ArraysToStringTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/ArraysToStringTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.string -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ArraysToStringTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class ArraysToStringTest extends InspectionTest { override val inspections = Seq(new ArraysToString) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/string/EmptyInterpolatedStringTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/string/EmptyInterpolatedStringTest.scala index df61fbe2..b161ee7b 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/EmptyInterpolatedStringTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/EmptyInterpolatedStringTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.string -import com.sksamuel.scapegoat.{isScala213, PluginRunner} -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.{isScala213, InspectionTest} /** @author Stephen Samuel */ -class EmptyInterpolatedStringTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class EmptyInterpolatedStringTest extends InspectionTest { override val inspections = Seq(new EmptyInterpolatedString) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/string/IllegalFormatStringTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/string/IllegalFormatStringTest.scala index 94d3752a..4330b0aa 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/IllegalFormatStringTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/IllegalFormatStringTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.string -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class IllegalFormatStringTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class IllegalFormatStringTest extends InspectionTest { override val inspections = Seq(new IllegalFormatString) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/string/IncorrectNumberOfArgsToFormatTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/string/IncorrectNumberOfArgsToFormatTest.scala index 7e38fba5..38e34741 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/IncorrectNumberOfArgsToFormatTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/IncorrectNumberOfArgsToFormatTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.string -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class IncorrectNumberOfArgsToFormatTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class IncorrectNumberOfArgsToFormatTest extends InspectionTest { override val inspections = Seq(new IncorrectNumberOfArgsToFormat) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/string/InvalidRegexTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/string/InvalidRegexTest.scala index f743eabb..90945d49 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/InvalidRegexTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/InvalidRegexTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.string -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class InvalidRegexTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class InvalidRegexTest extends InspectionTest { override val inspections = Seq(new InvalidRegex) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedStringTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedStringTest.scala index a574a099..ae3a10c4 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedStringTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedStringTest.scala @@ -1,15 +1,7 @@ package com.sksamuel.scapegoat.inspections.string -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers - -class LooksLikeInterpolatedStringTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +import com.sksamuel.scapegoat.InspectionTest +class LooksLikeInterpolatedStringTest extends InspectionTest { override val inspections = Seq(new LooksLikeInterpolatedString) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/string/StripMarginOnRegexTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/string/StripMarginOnRegexTest.scala index dedee8d1..7c540b9f 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/StripMarginOnRegexTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/StripMarginOnRegexTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.string -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class StripMarginOnRegexTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class StripMarginOnRegexTest extends InspectionTest { override val inspections = Seq(new StripMarginOnRegex) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/string/SubstringZeroTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/string/SubstringZeroTest.scala index 9cf69586..79e49422 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/SubstringZeroTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/SubstringZeroTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.string -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class SubstringZeroTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class SubstringZeroTest extends InspectionTest { override val inspections = Seq(new SubstringZero) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/string/UnsafeStringContainsTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/string/UnsafeStringContainsTest.scala index b825bf4c..488f29d8 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/UnsafeStringContainsTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/UnsafeStringContainsTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.string -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Zack Grannan */ -class UnsafeStringContainsTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class UnsafeStringContainsTest extends InspectionTest { override val inspections = Seq(new UnsafeStringContains) "unsafe string contains" - { "should report warning" in { diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/style/AvoidOperatorOverloadTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/style/AvoidOperatorOverloadTest.scala index b975df63..c081a5e7 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/style/AvoidOperatorOverloadTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/style/AvoidOperatorOverloadTest.scala @@ -1,12 +1,9 @@ package com.sksamuel.scapegoat.inspections.style -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class AvoidOperatorOverloadTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class AvoidOperatorOverloadTest extends InspectionTest { override val inspections = Seq(new AvoidOperatorOverload) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/style/ParameterlessMethodReturnsUnitTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/style/ParameterlessMethodReturnsUnitTest.scala index 6e1fce42..3e727f78 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/style/ParameterlessMethodReturnsUnitTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/style/ParameterlessMethodReturnsUnitTest.scala @@ -1,16 +1,9 @@ package com.sksamuel.scapegoat.inspections.style -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class ParameterlessMethodReturnsUnitTest - extends AnyFreeSpec - with Matchers - with PluginRunner - with OneInstancePerTest { +class ParameterlessMethodReturnsUnitTest extends InspectionTest { override val inspections = Seq(new ParameterlessMethodReturnsUnit) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/style/SimplifyBooleanExpressionTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/style/SimplifyBooleanExpressionTest.scala index e2895450..037ee27f 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/style/SimplifyBooleanExpressionTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/style/SimplifyBooleanExpressionTest.scala @@ -1,11 +1,9 @@ package com.sksamuel.scapegoat.inspections.style -import com.sksamuel.scapegoat.PluginRunner -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.InspectionTest /** @author Stephen Samuel */ -class SimplifyBooleanExpressionTest extends AnyFreeSpec with Matchers with PluginRunner { +class SimplifyBooleanExpressionTest extends InspectionTest { override val inspections = Seq(new SimplifyBooleanExpression) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/NoOpOverrideTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/NoOpOverrideTest.scala index 8b0ec3ef..e652991e 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/NoOpOverrideTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/NoOpOverrideTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections.unnecessary -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.NoOpOverride -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class NoOpOverrideTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class NoOpOverrideTest extends InspectionTest { override val inspections = Seq(new NoOpOverride) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryConversionTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryConversionTest.scala index bf661b8c..07ba47a3 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryConversionTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryConversionTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections.unnecessary -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.unneccesary.UnnecessaryConversion -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class UnnecessaryConversionTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class UnnecessaryConversionTest extends InspectionTest { override val inspections = Seq(new UnnecessaryConversion) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryIfTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryIfTest.scala index 11c923f3..aa185fb2 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryIfTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryIfTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections.unnecessary -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.unneccesary.UnnecessaryIf -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class UnnecessaryIfTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class UnnecessaryIfTest extends InspectionTest { override val inspections = Seq(new UnnecessaryIf) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryReturnUseTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryReturnUseTest.scala index 35a809ae..bb944100 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryReturnUseTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryReturnUseTest.scala @@ -1,12 +1,10 @@ package com.sksamuel.scapegoat.inspections.unnecessary -import com.sksamuel.scapegoat.PluginRunner +import com.sksamuel.scapegoat.InspectionTest import com.sksamuel.scapegoat.inspections.unneccesary.UnnecessaryReturnUse -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers /** @author Stephen Samuel */ -class UnnecessaryReturnUseTest extends AnyFreeSpec with Matchers with PluginRunner { +class UnnecessaryReturnUseTest extends InspectionTest { override val inspections = Seq(new UnnecessaryReturnUse) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnusedMethodParameterTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnusedMethodParameterTest.scala index 88950a81..59c2fb46 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnusedMethodParameterTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnusedMethodParameterTest.scala @@ -1,13 +1,10 @@ package com.sksamuel.scapegoat.inspections.unnecessary import com.sksamuel.scapegoat.inspections.unneccesary.UnusedMethodParameter -import com.sksamuel.scapegoat.{PluginRunner, Warning} -import org.scalatest.OneInstancePerTest -import org.scalatest.freespec.AnyFreeSpec -import org.scalatest.matchers.should.Matchers +import com.sksamuel.scapegoat.{InspectionTest, Warning} /** @author Stephen Samuel */ -class UnusedMethodParameterTest extends AnyFreeSpec with Matchers with PluginRunner with OneInstancePerTest { +class UnusedMethodParameterTest extends InspectionTest { override val inspections = Seq(new UnusedMethodParameter)