diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml
index 6e2d6afd..cc1bb3b1 100644
--- a/.github/workflows/pr-checks.yml
+++ b/.github/workflows/pr-checks.yml
@@ -12,8 +12,8 @@ jobs:
scala:
- 2.12.17
- 2.12.18
- - 2.13.10
- 2.13.11
+ - 2.13.12
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
diff --git a/README.md b/README.md
index 64a830aa..5052323e 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ Scapegoat
[![Codecov](https://img.shields.io/codecov/c/github/sksamuel/scapegoat)](https://codecov.io/gh/sksamuel/scapegoat)
[](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22scalac-scapegoat-plugin_2.11.12%22)
[](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22scalac-scapegoat-plugin_2.12.16%22)
-[](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22scalac-scapegoat-plugin_2.13.10%22)
+[](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22scalac-scapegoat-plugin_2.13.12%22)
[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)
Scapegoat is a Scala static code analyzer, which is more colloquially known as a code lint tool or linter. Scapegoat works in a similar vein to Java's [FindBugs](http://findbugs.sourceforge.net/) or [checkstyle](http://checkstyle.sourceforge.net/), or Scala's [Scalastyle](https://github.com/scalastyle/scalastyle).
diff --git a/build.sbt b/build.sbt
index 27128d36..10bd96c8 100644
--- a/build.sbt
+++ b/build.sbt
@@ -22,8 +22,8 @@ developers := List(
)
)
-scalaVersion := "2.13.11"
-crossScalaVersions := Seq("2.12.17", "2.12.18", "2.13.10", "2.13.11")
+scalaVersion := "2.13.12"
+crossScalaVersions := Seq("2.12.17", "2.12.18", "2.13.11", "2.13.12")
autoScalaLibrary := false
crossVersion := CrossVersion.full
crossTarget := {
diff --git a/src/main/scala/com/sksamuel/scapegoat/Inspection.scala b/src/main/scala/com/sksamuel/scapegoat/Inspection.scala
index 30481d32..aff3d585 100644
--- a/src/main/scala/com/sksamuel/scapegoat/Inspection.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/Inspection.scala
@@ -16,7 +16,7 @@ abstract class Inspection(
val self: Inspection = this
- def inspector(context: InspectionContext): Inspector
+ def inspector(ctx: InspectionContext): Inspector
def isEnabled: Boolean = true
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/AnyUse.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/AnyUse.scala
index 0dfacc9c..7ca2010b 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/AnyUse.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/AnyUse.scala
@@ -16,8 +16,8 @@ class AnyUse
explanation = "Code returning Any is most likely an indication of a programming error."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/AvoidToMinusOne.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/AvoidToMinusOne.scala
index 2d9bb3c6..1581a22d 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/AvoidToMinusOne.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/AvoidToMinusOne.scala
@@ -16,8 +16,8 @@ class AvoidToMinusOne
explanation = "A range in the following format (j to k - 1) can be simplified to (j until k)."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/BooleanParameter.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/BooleanParameter.scala
index aee73563..be765d83 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/BooleanParameter.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/BooleanParameter.scala
@@ -16,8 +16,8 @@ class BooleanParameter
explanation = "Method has Boolean parameter. Consider splitting into two methods or using a case class."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser = new context.Traverser {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/DoubleNegation.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/DoubleNegation.scala
index d624d36b..f5d87f6f 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/DoubleNegation.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/DoubleNegation.scala
@@ -14,8 +14,8 @@ class DoubleNegation
explanation = "Double negation can be removed, e.g. !(!b) it equal to just b."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/EmptyCaseClass.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/EmptyCaseClass.scala
index f9efaa72..835842bc 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/EmptyCaseClass.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/EmptyCaseClass.scala
@@ -14,8 +14,8 @@ class EmptyCaseClass
explanation = "An empty case class can be rewritten as a case object."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClass.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClass.scala
index 72c28c0d..d544dca4 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClass.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClass.scala
@@ -10,12 +10,12 @@ class FinalModifierOnCaseClass
explanation = "Using case classes without final modifier can lead to surprising breakage."
) {
- override def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ override def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
import context.global._
- override def postTyperTraverser =
+ override def postTyperTraverser: context.Traverser =
new context.Traverser {
override def inspect(tree: Tree): Unit = {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/LonelySealedTrait.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/LonelySealedTrait.scala
index 0f53ac2b..1a4fd537 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/LonelySealedTrait.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/LonelySealedTrait.scala
@@ -16,8 +16,8 @@ class LonelySealedTrait
explanation = "A sealed trait that is not extended is considered dead code."
) {
- override def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ override def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/MaxParameters.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/MaxParameters.scala
index d22e514a..44c1e219 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/MaxParameters.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/MaxParameters.scala
@@ -15,8 +15,8 @@ class MaxParameters
"Methods having a large number of parameters are more difficult to reason about, consider refactoring this code."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/NoOpOverride.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/NoOpOverride.scala
index 37b39945..e02249e4 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/NoOpOverride.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/NoOpOverride.scala
@@ -14,8 +14,8 @@ class NoOpOverride
explanation = "This method is overridden yet only calls super."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/PublicFinalizer.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/PublicFinalizer.scala
index 7dfc4245..9b94298e 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/PublicFinalizer.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/PublicFinalizer.scala
@@ -14,8 +14,8 @@ class PublicFinalizer
explanation = "Public finalizer should be avoided as finalizers should not be programmatically invoked."
) {
- override def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ override def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethod.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethod.scala
index 66f16ef7..6d88435c 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethod.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethod.scala
@@ -12,13 +12,13 @@ class RedundantFinalModifierOnMethod
explanation = "A final modifier on methods that cannot be overridden is redundant."
) {
- override def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ override def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
import context.global._
import definitions._
- override def postTyperTraverser =
+ override def postTyperTraverser: context.Traverser =
new context.Traverser {
override def inspect(tree: Tree): Unit = {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVar.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVar.scala
index e99afc0b..7cbc7f96 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVar.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVar.scala
@@ -10,12 +10,12 @@ class RedundantFinalModifierOnVar
explanation = "A final modifier on a var that cannot be overridden is redundant."
) {
- override def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ override def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
import context.global._
- override def postTyperTraverser =
+ override def postTyperTraverser: context.Traverser =
new context.Traverser {
override def inspect(tree: Tree): Unit = {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/TypeShadowing.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/TypeShadowing.scala
index e047dd16..a25e633b 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/TypeShadowing.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/TypeShadowing.scala
@@ -16,8 +16,8 @@ class TypeShadowing
explanation = "Shadowing type parameters is considered a bad practice and should be avoided."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/VarClosure.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/VarClosure.scala
index 5af0b456..14677c5b 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/VarClosure.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/VarClosure.scala
@@ -14,8 +14,8 @@ class VarClosure
explanation = "Closing over a var can lead to subtle bugs."
) {
- override def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ override def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/VarUse.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/VarUse.scala
index e4e7c500..c5ba010f 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/VarUse.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/VarUse.scala
@@ -11,9 +11,9 @@ class VarUse
"Use of variables is generally discouraged, especially in the context of a shared mutable state. Consider using an immutable state or other referentially transparent alternatives."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
- override def postTyperTraverser =
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
+ override def postTyperTraverser: context.Traverser =
new context.Traverser {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/VariableShadowing.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/VariableShadowing.scala
index ba0274f4..3e4db375 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/VariableShadowing.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/VariableShadowing.scala
@@ -13,8 +13,8 @@ class VariableShadowing
"Variable shadowing is very useful, but can easily lead to nasty bugs in your code. Shadowed variables can be potentially confusing to other maintainers when the same name is adopted to have a new meaning in a nested scope."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ArrayEquals.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ArrayEquals.scala
index 7d397275..4cf87d57 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ArrayEquals.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ArrayEquals.scala
@@ -15,8 +15,8 @@ class ArrayEquals
"Array equals is not an equality check. Use a.deep == b.deep or convert to another collection type."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeEqualsZero.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeEqualsZero.scala
index 49bb1197..9d3d0728 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeEqualsZero.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeEqualsZero.scala
@@ -15,8 +15,8 @@ class AvoidSizeEqualsZero
"Traversable.size can be slow for some data structures, prefer Traversable.isEmpty, which is O(1)."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeNotEqualsZero.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeNotEqualsZero.scala
index d45f2962..7ffe0a5d 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeNotEqualsZero.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeNotEqualsZero.scala
@@ -14,8 +14,8 @@ class AvoidSizeNotEqualsZero
explanation = ".size can be slow for some data structures, prefer .nonEmpty, which is O(1)."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionIndexOnNonIndexedSeq.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionIndexOnNonIndexedSeq.scala
index 0d8aacf9..828cefee 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionIndexOnNonIndexedSeq.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionIndexOnNonIndexedSeq.scala
@@ -14,8 +14,8 @@ class CollectionIndexOnNonIndexedSeq
explanation = "Using an index to access elements of an IndexedSeq may cause performance problems."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNamingConfusion.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNamingConfusion.scala
index 1eeccf3f..4c9f3fc2 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNamingConfusion.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNamingConfusion.scala
@@ -15,8 +15,8 @@ class CollectionNamingConfusion
"E.g. an instance of a Set is confusingly referred to by a variable called/containing list, or the other way around."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNegativeIndex.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNegativeIndex.scala
index 9b61f372..cc36433d 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNegativeIndex.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNegativeIndex.scala
@@ -15,8 +15,8 @@ class CollectionNegativeIndex
"Trying to access Seq elements using a negative index will result in an IndexOutOfBoundsException."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionPromotionToAny.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionPromotionToAny.scala
index 1f71a90d..b75bdcf8 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionPromotionToAny.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/CollectionPromotionToAny.scala
@@ -15,8 +15,8 @@ class CollectionPromotionToAny
"The `:+` (append) operator on collections accepts any argument you give it, which means that you can end up with e.g. `Seq[Any]` if your types don't match."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptyList.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptyList.scala
index c70aa3cf..dc40fdd8 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptyList.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptyList.scala
@@ -14,8 +14,8 @@ class ComparisonToEmptyList
explanation = "Prefer use of `isEmpty` instead of comparison to an empty List."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptySet.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptySet.scala
index d2130215..f81b67dd 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptySet.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptySet.scala
@@ -14,8 +14,8 @@ class ComparisonToEmptySet
explanation = "Prefer use of `isEmpty` instead of comparison to an empty Set."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateMapKey.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateMapKey.scala
index da8f5fc3..cd7a3015 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateMapKey.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateMapKey.scala
@@ -14,8 +14,8 @@ class DuplicateMapKey
explanation = "A map key is overwritten by a later entry."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateSetValue.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateSetValue.scala
index de8944a2..c52560bb 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateSetValue.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateSetValue.scala
@@ -14,8 +14,8 @@ class DuplicateSetValue
explanation = "A set value is overwritten by a later entry."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ExistsSimplifiableToContains.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ExistsSimplifiableToContains.scala
index cd2dd7ed..79f37976 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ExistsSimplifiableToContains.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ExistsSimplifiableToContains.scala
@@ -16,8 +16,8 @@ class ExistsSimplifiableToContains
explanation = "`exists(x => x == y)` can be replaced with `contains(y)`."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHead.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHead.scala
index 3f046f8e..9aea9637 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHead.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHead.scala
@@ -15,8 +15,8 @@ class FilterDotHead
"`filter().head` can throw an exception if the collection is empty - it can be replaced with `find() match {...}`."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadOption.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadOption.scala
index ffce2ccf..dc8429fc 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadOption.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadOption.scala
@@ -15,8 +15,8 @@ class FilterDotHeadOption
"`filter()` scans the entire collection, which is unnecessary if you only want to get the first element that satisfies the predicate - `filter().headOption` can be replaced with `find()` to potentially avoid scanning the entire collection."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotIsEmpty.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotIsEmpty.scala
index acd7a45c..b9d4dfaf 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotIsEmpty.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotIsEmpty.scala
@@ -15,8 +15,8 @@ class FilterDotIsEmpty
"`filter()` scans the entire collection, which can potentially be avoided if the element exists in the collection - `filter().isEmpty` can be replaced with `!exists()`."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotSize.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotSize.scala
index 4c102471..d0596679 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotSize.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotSize.scala
@@ -16,8 +16,8 @@ class FilterDotSize
explanation = "`filter().size` can be replaced with `count()`, which is more concise."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterOptionAndGet.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterOptionAndGet.scala
index b3d2870b..1ccdc8df 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterOptionAndGet.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FilterOptionAndGet.scala
@@ -14,8 +14,8 @@ class FilterOptionAndGet
explanation = "`filter(_.isDefined).map(_.get)` can be replaced with `flatten`."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExists.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExists.scala
index 7d3f3cd7..a6e67e4e 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExists.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExists.scala
@@ -10,9 +10,9 @@ class FindAndNotEqualsNoneReplaceWithExists
explanation = "`find() != None` can be replaced with `exists()`, which is more concise."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
- override def postTyperTraverser =
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
+ override def postTyperTraverser: context.Traverser =
new context.Traverser {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FindDotIsDefined.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FindDotIsDefined.scala
index 0e37bf1a..a81220da 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FindDotIsDefined.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/FindDotIsDefined.scala
@@ -14,8 +14,8 @@ class FindDotIsDefined
explanation = "`find().isDefined` can be replaced with `exists()`, which is more concise."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/JavaConversionsUse.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/JavaConversionsUse.scala
index 577a72ff..1cd5a059 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/JavaConversionsUse.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/JavaConversionsUse.scala
@@ -15,8 +15,8 @@ class JavaConversionsUse
"Use of Java conversions can lead to unusual behaviour. It is recommended to use JavaConverters."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ListAppend.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ListAppend.scala
index 3ea7a5bb..125beb9e 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ListAppend.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ListAppend.scala
@@ -15,8 +15,8 @@ class ListAppend
"List append is O(n). For large lists, consider using cons (::) or another data structure such as ListBuffer, Vector or a cats.data.Chain (which has constant prepend and append)."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ListSize.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ListSize.scala
index 8f60ca6e..28f05387 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ListSize.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ListSize.scala
@@ -15,8 +15,8 @@ class ListSize
"List.size is O(n). Consider using a different data type with O(1) size lookup such as Vector or an Array."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/MapGetAndGetOrElse.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/MapGetAndGetOrElse.scala
index 114716d2..cdd5c82e 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/MapGetAndGetOrElse.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/MapGetAndGetOrElse.scala
@@ -18,8 +18,8 @@ class MapGetAndGetOrElse
"Map.get(key).getOrElse(value) can be replaced with Map.getOrElse(key, value), which is more concise."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/NegationIsEmpty.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/NegationIsEmpty.scala
index 4c12f8d3..4f804725 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/NegationIsEmpty.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/NegationIsEmpty.scala
@@ -14,8 +14,8 @@ class NegationIsEmpty
explanation = "!.isEmpty can be replaced with.nonEmpty to make it easier to reason about."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/NegationNonEmpty.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/NegationNonEmpty.scala
index fb42d954..135a9f71 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/NegationNonEmpty.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/NegationNonEmpty.scala
@@ -14,8 +14,8 @@ class NegationNonEmpty
explanation = "!.nonEmpty can be replaced with.isEmpty to make it easier to reason about."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/NegativeSeqPad.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/NegativeSeqPad.scala
index 30867cd0..42321693 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/NegativeSeqPad.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/NegativeSeqPad.scala
@@ -14,8 +14,8 @@ class NegativeSeqPad
explanation = "Seq.padTo with a negative length will not have any effect."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PredefIterableIsMutable.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PredefIterableIsMutable.scala
index cee77833..0af2a08a 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PredefIterableIsMutable.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PredefIterableIsMutable.scala
@@ -17,8 +17,8 @@ class PredefIterableIsMutable
override def isEnabled: Boolean = !isScala213
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PredefSeqIsMutable.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PredefSeqIsMutable.scala
index 9425f0de..b357685f 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PredefSeqIsMutable.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PredefSeqIsMutable.scala
@@ -16,8 +16,8 @@ class PredefSeqIsMutable
override def isEnabled: Boolean = !isScala213
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PredefTraversableIsMutable.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PredefTraversableIsMutable.scala
index 390ebb81..6bbd4f69 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PredefTraversableIsMutable.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PredefTraversableIsMutable.scala
@@ -17,8 +17,8 @@ class PredefTraversableIsMutable
override def isEnabled: Boolean = !isScala213
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmpty.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmpty.scala
index 4955b606..7c734b01 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmpty.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmpty.scala
@@ -11,9 +11,9 @@ class PreferMapEmpty
"`Map[K,V]()` allocates an intermediate object. Consider `Map.empty` which returns a singleton instance without creating a new object."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
- override def postTyperTraverser =
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
+ override def postTyperTraverser: context.Traverser =
new context.Traverser {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferSeqEmpty.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferSeqEmpty.scala
index bf9c3be2..fd1303bf 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferSeqEmpty.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferSeqEmpty.scala
@@ -15,8 +15,8 @@ class PreferSeqEmpty
"`Seq[T]()` allocates an intermediate object. Consider `Seq.empty` which returns a singleton instance without creating a new object."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferSetEmpty.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferSetEmpty.scala
index 1de0ee17..c5e4c8b0 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferSetEmpty.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/PreferSetEmpty.scala
@@ -15,8 +15,8 @@ class PreferSetEmpty
"`Set[T]()` allocates an intermediate object. Consider `Set.empty` which returns a singleton instance without creating a new object."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ReverseFunc.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ReverseFunc.scala
index a1e27f77..52acb6d6 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ReverseFunc.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ReverseFunc.scala
@@ -24,8 +24,8 @@ class ReverseFunc
funcReplace.find(_._1 == func)
}
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTailReverse.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTailReverse.scala
index 07e2157a..87f5e34c 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTailReverse.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTailReverse.scala
@@ -10,8 +10,8 @@ class ReverseTailReverse
explanation = "`reverse.tail.reverse` can be replaced with `init`, which is more concise."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTakeReverse.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTakeReverse.scala
index d9a224eb..16dced4b 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTakeReverse.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTakeReverse.scala
@@ -10,8 +10,8 @@ class ReverseTakeReverse
explanation = "`reverse.take().reverse` can be replaced with `takeRight`, which is more concise."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/SwapSortFilter.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/SwapSortFilter.scala
index 01f9e86b..c49f97cc 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/SwapSortFilter.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/SwapSortFilter.scala
@@ -15,8 +15,8 @@ class SwapSortFilter
"Filter first and then sort the remaining collection. Swap sort.filter for filter.sort for better performance."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeContains.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeContains.scala
index 2f8a8136..c516e751 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeContains.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeContains.scala
@@ -15,8 +15,8 @@ class UnsafeContains
"`contains()` accepts arguments af any type, which means you might be checking if your collection contains an element of an unrelated type."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeTraversableMethods.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeTraversableMethods.scala
index 8749785d..2f14c91c 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeTraversableMethods.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeTraversableMethods.scala
@@ -25,8 +25,8 @@ class UnsafeTraversableMethods
"minBy"
)
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBody.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBody.scala
index 2ea44f63..d331a79d 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBody.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBody.scala
@@ -11,9 +11,9 @@ class RepeatedIfElseBody
"The if statement could be refactored if both branches are the same or start with the same."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
- override def postTyperTraverser =
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
+ override def postTyperTraverser: context.Traverser =
new context.Traverser {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/WhileTrue.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/WhileTrue.scala
index 20229820..81ffe0ab 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/WhileTrue.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/controlflow/WhileTrue.scala
@@ -14,8 +14,8 @@ class WhileTrue
explanation = "A (do) while true loop is unlikely to be meant for production."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyFor.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyFor.scala
index c88feba7..c9b60c7b 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyFor.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyFor.scala
@@ -14,8 +14,8 @@ class EmptyFor
explanation = "An empty for loop isn't a common practice and in most cases is considered as dead code."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyIfBlock.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyIfBlock.scala
index 8f259454..289dad0c 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyIfBlock.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyIfBlock.scala
@@ -14,8 +14,8 @@ class EmptyIfBlock
explanation = "An empty if block is considered as dead code."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyMethod.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyMethod.scala
index 071f70c1..3bea64e5 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyMethod.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyMethod.scala
@@ -14,8 +14,8 @@ class EmptyMethod
explanation = "An empty method is considered as dead code."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptySynchronizedBlock.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptySynchronizedBlock.scala
index 29d964f7..a9be8a0c 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptySynchronizedBlock.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptySynchronizedBlock.scala
@@ -14,8 +14,8 @@ class EmptySynchronizedBlock
explanation = "An empty synchronized block is considered as dead code."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyTryBlock.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyTryBlock.scala
index c115b7ea..87337a3c 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyTryBlock.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyTryBlock.scala
@@ -14,8 +14,8 @@ class EmptyTryBlock
explanation = "An empty try block is considered as dead code."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyWhileBlock.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyWhileBlock.scala
index baeb23cd..906cbdcd 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyWhileBlock.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/empty/EmptyWhileBlock.scala
@@ -14,8 +14,8 @@ class EmptyWhileBlock
explanation = "An empty while block is considered as dead code."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/equality/ComparingFloatingPointTypes.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/equality/ComparingFloatingPointTypes.scala
index 84c64395..718754db 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/equality/ComparingFloatingPointTypes.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/equality/ComparingFloatingPointTypes.scala
@@ -15,8 +15,8 @@ class ComparingFloatingPointTypes
"Due to minor rounding errors, it is not advisable to compare floating-point numbers using the == operator. Either use a threshold based comparison, or switch to a BigDecimal."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/equality/ComparingUnrelatedTypes.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/equality/ComparingUnrelatedTypes.scala
index b4f3e601..c794e68b 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/equality/ComparingUnrelatedTypes.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/equality/ComparingUnrelatedTypes.scala
@@ -15,8 +15,8 @@ class ComparingUnrelatedTypes
"In most case comparing unrelated types cannot succeed and it's usually an indication of a bug."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/equality/ComparisonWithSelf.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/equality/ComparisonWithSelf.scala
index 3d28f810..d0f49fed 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/equality/ComparisonWithSelf.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/equality/ComparisonWithSelf.scala
@@ -14,8 +14,8 @@ class ComparisonWithSelf
explanation = "Comparison with self will always yield true."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchException.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchException.scala
index a36911b3..e19391ec 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchException.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchException.scala
@@ -16,8 +16,8 @@ class CatchException
"Did you intend to catch all exceptions? Consider catching a more specific exception class."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionImmediatelyRethrown.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionImmediatelyRethrown.scala
index 8f571dd2..1be3070f 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionImmediatelyRethrown.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionImmediatelyRethrown.scala
@@ -10,8 +10,8 @@ class CatchExceptionImmediatelyRethrown
explanation = "Immediately re-throwing a caught exception is equivalent to not catching it at all."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchFatal.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchFatal.scala
index ccef12cb..cb36c91c 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchFatal.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchFatal.scala
@@ -18,8 +18,8 @@ class CatchFatal
"Did you intend to catch a fatal exception? Consider using scala.util.control.NonFatal instead."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchNpe.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchNpe.scala
index db760e38..d8932be2 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchNpe.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchNpe.scala
@@ -14,8 +14,8 @@ class CatchNpe
explanation =
"Avoid using null at all cost and you shouldn't need to catch NullPointerExceptions. Prefer Option to indicate potentially missing values and use Try to materialize exceptions thrown by any external libraries."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchThrowable.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchThrowable.scala
index f42ef419..14eec9ba 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchThrowable.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/CatchThrowable.scala
@@ -15,8 +15,8 @@ class CatchThrowable
"Did you intend to catch all throwables? Consider catching a more specific exception class."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/IncorrectlyNamedExceptions.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/IncorrectlyNamedExceptions.scala
index 13eabf2e..16f27b45 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/IncorrectlyNamedExceptions.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/IncorrectlyNamedExceptions.scala
@@ -17,8 +17,8 @@ class IncorrectlyNamedExceptions
"Class named exception does not derive from Exception / class derived from Exception is not named *Exception."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/SwallowedException.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/SwallowedException.scala
index f1d9c1a8..f286fa32 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/SwallowedException.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/SwallowedException.scala
@@ -16,8 +16,8 @@ class SwallowedException
"If you use a try/catch block to deal with an exception, you should handle all of the caught exceptions and if for some reason you're throwing another exception in the result, you should include the original exception as the cause."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/UnreachableCatch.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/UnreachableCatch.scala
index 805ed40c..48adc00f 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/exception/UnreachableCatch.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/exception/UnreachableCatch.scala
@@ -16,8 +16,8 @@ class UnreachableCatch
explanation = "One or more cases are unreachable."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/imports/DuplicateImport.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/imports/DuplicateImport.scala
index 7861fe5e..938d98e5 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/imports/DuplicateImport.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/imports/DuplicateImport.scala
@@ -16,8 +16,8 @@ class DuplicateImport
explanation = "Duplicate imports should be removed."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
private val imports = mutable.HashSet[String]()
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/imports/WildcardImport.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/imports/WildcardImport.scala
index 95359316..e371a353 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/imports/WildcardImport.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/imports/WildcardImport.scala
@@ -15,8 +15,8 @@ class WildcardImport
"Avoid using wildcard imports, unless you are importing more than a few entities. Wildcard imports make the code more difficult to maintain."
) {
- override def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ override def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/inference/BoundedByFinalType.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/inference/BoundedByFinalType.scala
index f878f31b..1def36d6 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/inference/BoundedByFinalType.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/inference/BoundedByFinalType.scala
@@ -14,8 +14,8 @@ class BoundedByFinalType
explanation = "Pointless type bound. Type parameter can only be a single value."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/inference/MethodReturningAny.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/inference/MethodReturningAny.scala
index ffdf23dd..2637f645 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/inference/MethodReturningAny.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/inference/MethodReturningAny.scala
@@ -16,8 +16,8 @@ class MethodReturningAny
explanation = "Method returns Any. Consider using a more specialized type."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/inference/PointlessTypeBounds.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/inference/PointlessTypeBounds.scala
index 029ee16e..41368144 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/inference/PointlessTypeBounds.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/inference/PointlessTypeBounds.scala
@@ -14,8 +14,8 @@ class PointlessTypeBounds
explanation = "Type bound resolves to `Nothing <: T <: Any`. Did you mean to put in other bounds?"
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/inference/ProductWithSerializableInferred.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/inference/ProductWithSerializableInferred.scala
index 45c8b882..1f28acac 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/inference/ProductWithSerializableInferred.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/inference/ProductWithSerializableInferred.scala
@@ -17,8 +17,8 @@ class ProductWithSerializableInferred
"It is unlikely that Product with Serializable was your target type. This is often an indication of mixing up incompatible types."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/matching/PartialFunctionInsteadOfMatch.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/matching/PartialFunctionInsteadOfMatch.scala
index 4dd9994c..e34e063c 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/matching/PartialFunctionInsteadOfMatch.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/matching/PartialFunctionInsteadOfMatch.scala
@@ -14,8 +14,8 @@ class PartialFunctionInsteadOfMatch
explanation = "A map match can be replaced with a partial function for greater readability."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/matching/RepeatedCaseBody.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/matching/RepeatedCaseBody.scala
index 5a34627e..66eb363b 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/matching/RepeatedCaseBody.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/matching/RepeatedCaseBody.scala
@@ -16,8 +16,8 @@ class RepeatedCaseBody
explanation = "Case body is repeated. Consider merging pattern clauses together."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/matching/SuspiciousMatchOnClassObject.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/matching/SuspiciousMatchOnClassObject.scala
index df1eed45..90fb03f8 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/matching/SuspiciousMatchOnClassObject.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/matching/SuspiciousMatchOnClassObject.scala
@@ -14,8 +14,8 @@ class SuspiciousMatchOnClassObject
explanation = "Matching on an companion object of a case class is probably not what you intended."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalDoubleConstructor.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalDoubleConstructor.scala
index 10ba8b33..873d21a1 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalDoubleConstructor.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalDoubleConstructor.scala
@@ -15,8 +15,8 @@ class BigDecimalDoubleConstructor
"The results of this constructor can be somewhat unpredictable. E.g. writing new BigDecimal(0.1) in Java creates a BigDecimal which is actually equal to 0.1000000000000000055511151231257827021181583404541015625. This is because 0.1 cannot be represented exactly as a double."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalScaleWithoutRoundingMode.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalScaleWithoutRoundingMode.scala
index c09d97fa..ba93dc96 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalScaleWithoutRoundingMode.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalScaleWithoutRoundingMode.scala
@@ -16,8 +16,8 @@ class BigDecimalScaleWithoutRoundingMode
"When using `setScale()` on a BigDecimal without setting the rounding mode, this can throw an exception if rounding is required. Did you mean to call `setScale(s, RoundingMode.XYZ)`?"
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/math/BrokenOddness.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/math/BrokenOddness.scala
index 2931294a..bc1d0763 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/BrokenOddness.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/BrokenOddness.scala
@@ -17,8 +17,8 @@ class BrokenOddness
"Code that attempts to check for oddness using `x % 2 == 1` will fail on negative numbers. Consider using `x % 2 != 0`."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/math/DivideByOne.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/math/DivideByOne.scala
index c630bb77..3bc5ced2 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/DivideByOne.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/DivideByOne.scala
@@ -14,8 +14,8 @@ class DivideByOne
explanation = "Divide by one will always return the original value."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/math/ModOne.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/math/ModOne.scala
index 0b105958..c4fac137 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/ModOne.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/ModOne.scala
@@ -16,8 +16,8 @@ class ModOne
explanation = "Any expression x % 1 will always return 0."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/math/NanComparison.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/math/NanComparison.scala
index dfe24f3b..949fc49b 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/NanComparison.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/NanComparison.scala
@@ -14,8 +14,8 @@ class NanComparison
explanation = "NaN comparison will always fail. Use value.isNan instead."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseCbrt.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseCbrt.scala
index 0a6585a6..e1e184fa 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseCbrt.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseCbrt.scala
@@ -14,8 +14,8 @@ class UseCbrt
explanation = "Use math.cbrt, which is clearer and more performant than math.pow(x, 1/3)."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseExpM1.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseExpM1.scala
index 32c11389..c644e890 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseExpM1.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseExpM1.scala
@@ -14,8 +14,8 @@ class UseExpM1
explanation = "Use math.expm1(x), which is clearer and more performant than math.exp(x) - 1."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseLog10.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseLog10.scala
index 1951e328..c56326d2 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseLog10.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseLog10.scala
@@ -10,8 +10,8 @@ class UseLog10
explanation = "Use math.log10(x), which is clearer and more performant than $math.log(x)/$math.log(10)."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseLog1P.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseLog1P.scala
index 64ffcc0f..73ad5156 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseLog1P.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseLog1P.scala
@@ -10,8 +10,8 @@ class UseLog1P
explanation = "Use math.log1p(x) is clearer and more performant than $math.log(1 + x)."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseSqrt.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseSqrt.scala
index d2c54158..19d84db7 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseSqrt.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseSqrt.scala
@@ -10,8 +10,8 @@ class UseSqrt
explanation = "Use math.sqrt, which is clearer and more performant than $math.pow(x, 0.5)."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/math/ZeroNumerator.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/math/ZeroNumerator.scala
index e173c0ad..98648250 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/ZeroNumerator.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/ZeroNumerator.scala
@@ -14,8 +14,8 @@ class ZeroNumerator
explanation = "Dividing zero by any number will always return zero, e.g. 0 / x == 0."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/naming/ClassNames.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/naming/ClassNames.scala
index 2c8533bc..576a29af 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/naming/ClassNames.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/naming/ClassNames.scala
@@ -14,8 +14,8 @@ class ClassNames
explanation = "Class names should begin with uppercase letter."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/naming/MethodNames.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/naming/MethodNames.scala
index f327dcad..3f55d8a2 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/naming/MethodNames.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/naming/MethodNames.scala
@@ -17,8 +17,8 @@ class MethodNames
"Methods should be in camelCase style with the first letter lower-case. See http://docs.scala-lang.org/style/naming-conventions.html#methods."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/naming/ObjectNames.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/naming/ObjectNames.scala
index 75bd3333..0137f812 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/naming/ObjectNames.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/naming/ObjectNames.scala
@@ -14,8 +14,8 @@ class ObjectNames
explanation = "Object names should only contain alphanumeric characters."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/nulls/NullAssignment.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/nulls/NullAssignment.scala
index 6b909201..c84cbbc3 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/nulls/NullAssignment.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/nulls/NullAssignment.scala
@@ -14,8 +14,8 @@ class NullAssignment
explanation = "Use an Option instead when the value can be empty."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/nulls/NullParameter.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/nulls/NullParameter.scala
index 7d5b4e43..4f8a0af7 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/nulls/NullParameter.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/nulls/NullParameter.scala
@@ -14,8 +14,8 @@ class NullParameter
explanation = "Use an Option instead when the value can be empty and pass down a None instead."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/option/EitherGet.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/option/EitherGet.scala
index 97353760..8bdcd00a 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/option/EitherGet.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/option/EitherGet.scala
@@ -15,8 +15,8 @@ class EitherGet
"Method .get on a Left and a Right projection is deprecated since 2.13, use Either.getOrElse or Either.swap.getOrElse instead."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/option/ImpossibleOptionSizeCondition.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/option/ImpossibleOptionSizeCondition.scala
index 2eed6cc3..fdcbcd58 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/option/ImpossibleOptionSizeCondition.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/option/ImpossibleOptionSizeCondition.scala
@@ -14,8 +14,8 @@ class ImpossibleOptionSizeCondition
explanation = "Option.size > 1 can never be true, did you mean to use Option.nonEmpty instead?"
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/option/OptionGet.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/option/OptionGet.scala
index d2096d98..dc67e97d 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/option/OptionGet.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/option/OptionGet.scala
@@ -15,8 +15,8 @@ class OptionGet
"Using Option.get defeats the purpose of using Option in the first place. Use the following instead: Option.getOrElse, Option.fold, pattern matching or don't take the value out of the container and map over it to transform it."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/option/OptionSize.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/option/OptionSize.scala
index f10bfea6..8406f7c5 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/option/OptionSize.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/option/OptionSize.scala
@@ -15,8 +15,8 @@ class OptionSize
"Prefer to use Option.isDefined, Option.isEmpty or Option.nonEmpty instead of Option.size."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/string/ArraysInFormat.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/string/ArraysInFormat.scala
index 94140b11..ac3748a7 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/string/ArraysInFormat.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/string/ArraysInFormat.scala
@@ -14,8 +14,8 @@ class ArraysInFormat
explanation = "An Array passed to String.format might result in an incorrect formatting."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/string/ArraysToString.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/string/ArraysToString.scala
index 7f31b86b..d72783fe 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/string/ArraysToString.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/string/ArraysToString.scala
@@ -14,8 +14,8 @@ class ArraysToString
explanation = "Calling toString on an array does not perform a deep toString."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/string/EmptyInterpolatedString.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/string/EmptyInterpolatedString.scala
index 47b3d737..6ace82e4 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/string/EmptyInterpolatedString.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/string/EmptyInterpolatedString.scala
@@ -15,8 +15,8 @@ class EmptyInterpolatedString
"String declared as interpolated but has no parameters can be turned into a regular string."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/string/IllegalFormatString.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/string/IllegalFormatString.scala
index 83d27096..376fc56a 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/string/IllegalFormatString.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/string/IllegalFormatString.scala
@@ -20,8 +20,8 @@ class IllegalFormatString
// format is: %[argument_index$][flags][width][.precision][t]conversion
final val argRegex = "%(\\d+\\$)?[-#+ 0,(\\<]*?\\d*(\\.\\d+)?[tT]?[a-zA-Z]".r
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/string/IncorrectNumberOfArgsToFormat.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/string/IncorrectNumberOfArgsToFormat.scala
index 7794688d..e6570f9b 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/string/IncorrectNumberOfArgsToFormat.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/string/IncorrectNumberOfArgsToFormat.scala
@@ -19,8 +19,8 @@ class IncorrectNumberOfArgsToFormat
// OR: %%
final val argRegex = "%((\\d+\\$)?[-#+ 0,(\\<]*?\\d?(\\.\\d+)?[tT]?[a-zA-Z]|%)".r
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/string/InvalidRegex.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/string/InvalidRegex.scala
index ca201fd6..18f6ca27 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/string/InvalidRegex.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/string/InvalidRegex.scala
@@ -17,8 +17,8 @@ class InvalidRegex
"Invalid regex literals can fail at compile time with a PatternSyntaxException. This could be caused by e.g. dangling meta characters, or unclosed escape characters, etc."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedString.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedString.scala
index 04ff0f33..0f726f20 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedString.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedString.scala
@@ -13,9 +13,9 @@ class LooksLikeInterpolatedString
final val regex1 = "\\$\\{[a-z][.a-zA-Z0-9_]*\\}".r
final val regex2 = "\\$[a-z][.a-zA-Z0-9_]*".r
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
- override def postTyperTraverser =
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
+ override def postTyperTraverser: context.Traverser =
new context.Traverser {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/string/StripMarginOnRegex.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/string/StripMarginOnRegex.scala
index 6b488512..b0761faf 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/string/StripMarginOnRegex.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/string/StripMarginOnRegex.scala
@@ -14,8 +14,8 @@ class StripMarginOnRegex
explanation = "Strip margin will strip | from regex - possible corrupted regex."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/string/SubstringZero.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/string/SubstringZero.scala
index be0a0b32..e6e6b21d 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/string/SubstringZero.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/string/SubstringZero.scala
@@ -14,8 +14,8 @@ class SubstringZero
explanation = "Use of String.substring(0) will always return the same string."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/string/UnsafeStringContains.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/string/UnsafeStringContains.scala
index 34593eca..80013504 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/string/UnsafeStringContains.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/string/UnsafeStringContains.scala
@@ -15,8 +15,8 @@ class UnsafeStringContains
"String.contains() accepts arguments af any type, which means you might be checking if your string contains an element of an unrelated type."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/style/AvoidOperatorOverload.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/style/AvoidOperatorOverload.scala
index 3faba616..076db1db 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/style/AvoidOperatorOverload.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/style/AvoidOperatorOverload.scala
@@ -19,8 +19,8 @@ class AvoidOperatorOverload
"Scala style guide advocates against routinely using operators as method names, see http://docs.scala-lang.org/style/naming-conventions.html#symbolic-method-names."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/style/ParameterlessMethodReturnsUnit.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/style/ParameterlessMethodReturnsUnit.scala
index 0c6b558e..888d0498 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/style/ParameterlessMethodReturnsUnit.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/style/ParameterlessMethodReturnsUnit.scala
@@ -15,8 +15,8 @@ class ParameterlessMethodReturnsUnit
"Methods should be defined with empty parentheses if they have side effects. A method returning Unit must have side effects, therefore you should declare it with ()."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/style/SimplifyBooleanExpression.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/style/SimplifyBooleanExpression.scala
index 3ace2b60..abded32a 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/style/SimplifyBooleanExpression.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/style/SimplifyBooleanExpression.scala
@@ -13,8 +13,8 @@ class SimplifyBooleanExpression
description = "Checks for boolean expressions that can be simplified.",
explanation = "Boolean expressions such as x == false can be re-written as !x."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/ConstantIf.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/ConstantIf.scala
index 4c389ea8..01417a69 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/ConstantIf.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/ConstantIf.scala
@@ -17,8 +17,8 @@ class ConstantIf
"An if condition which gets compiled to a constant, like e.g. if (1 < 2) or if (false) doesn't add any value and should be avoided."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/RedundantFinalizer.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/RedundantFinalizer.scala
index 452ac48c..71d24450 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/RedundantFinalizer.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/RedundantFinalizer.scala
@@ -17,8 +17,8 @@ class RedundantFinalizer
"An empty finalizer, e.g. override def finalize: Unit = {} is redundant and should be removed."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/StoreBeforeReturn.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/StoreBeforeReturn.scala
index 53185b4e..f08bd94b 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/StoreBeforeReturn.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/StoreBeforeReturn.scala
@@ -11,8 +11,8 @@ class StoreBeforeReturn
"Storing a value and then immediately returning it is equivalent to returning the raw value itself."
) {
- override def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ override def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnnecessaryConversion.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnnecessaryConversion.scala
index 5109df2f..4a36014a 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnnecessaryConversion.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnnecessaryConversion.scala
@@ -15,8 +15,8 @@ class UnnecessaryConversion
"Calling e.g. toString on a String or toList on a List is completely unnecessary and it's an equivalent to identity."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnnecessaryIf.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnnecessaryIf.scala
index 1e95bdfb..bb140a11 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnnecessaryIf.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnnecessaryIf.scala
@@ -15,8 +15,8 @@ class UnnecessaryIf
"If comparison is not needed. Use the condition, e.g. instead of if (a == b) true else false, use a == b or instead of if (a == b) false else true, use !(a == b)."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnnecessaryReturnUse.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnnecessaryReturnUse.scala
index 7f107334..30e0f202 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnnecessaryReturnUse.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnnecessaryReturnUse.scala
@@ -15,8 +15,8 @@ class UnnecessaryReturnUse
"Scala returns the value of the last expression in a block. Use of return here is not an idiomatic Scala."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnusedMethodParameter.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnusedMethodParameter.scala
index 4300a715..4ec1719a 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnusedMethodParameter.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/UnusedMethodParameter.scala
@@ -16,8 +16,8 @@ class UnusedMethodParameter
explanation = "Unused constructor or method parameters should be removed."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/VarCouldBeVal.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/VarCouldBeVal.scala
index 4ac3c1f9..23672a2b 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/VarCouldBeVal.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unneccesary/VarCouldBeVal.scala
@@ -16,8 +16,8 @@ class VarCouldBeVal
explanation = "A variable (var) that is never written to could be turned into a value (val)."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/AsInstanceOf.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/AsInstanceOf.scala
index 5b1226bc..a4b2e3ea 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/AsInstanceOf.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/AsInstanceOf.scala
@@ -11,9 +11,9 @@ class AsInstanceOf
"Use of asInstanceOf is considered a bad practice - consider using pattern matching instead."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
- override def postTyperTraverser =
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
+ override def postTyperTraverser: context.Traverser =
new context.Traverser {
import context.global._
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/FinalizerWithoutSuper.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/FinalizerWithoutSuper.scala
index 09c7fa6f..a47d6b9c 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/FinalizerWithoutSuper.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/FinalizerWithoutSuper.scala
@@ -15,8 +15,8 @@ class FinalizerWithoutSuper
"Finalizers should call `super.finalize()` to ensure superclasses are able to run their finalization logic."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/IsInstanceOf.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/IsInstanceOf.scala
index 02052c9c..ee3c741b 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/IsInstanceOf.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/IsInstanceOf.scala
@@ -15,8 +15,8 @@ class IsInstanceOf
"Use of isInstanceOf is considered a bad practice - consider using pattern matching instead."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/TryGet.scala b/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/TryGet.scala
index 73df66d7..9aeac5b3 100644
--- a/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/TryGet.scala
+++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/TryGet.scala
@@ -15,8 +15,8 @@ class TryGet
"Using Try.get is unsafe because it will throw the underlying exception in case of a Failure. Use the following instead: Try.getOrElse, Try.fold, pattern matching or don't take the value out of the container and map over it to transform it."
) {
- def inspector(context: InspectionContext): Inspector =
- new Inspector(context) {
+ def inspector(ctx: InspectionContext): Inspector =
+ new Inspector(ctx) {
override def postTyperTraverser: context.Traverser =
new context.Traverser {
diff --git a/src/test/scala-2.13/com/sksamuel/scapegoat/inspections/unnecessary/UnusedMethodParameterTest213.scala b/src/test/scala-2.13/com/sksamuel/scapegoat/inspections/unnecessary/UnusedMethodParameterTest213.scala
index cf4da348..642a8a8f 100644
--- a/src/test/scala-2.13/com/sksamuel/scapegoat/inspections/unnecessary/UnusedMethodParameterTest213.scala
+++ b/src/test/scala-2.13/com/sksamuel/scapegoat/inspections/unnecessary/UnusedMethodParameterTest213.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.unnecessary
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.unneccesary.UnusedMethodParameter
class UnusedMethodParameterTest213 extends InspectionTest {
- override val inspections = Seq(new UnusedMethodParameter)
+ override val inspections = Seq[Inspection](new UnusedMethodParameter)
"UnusedMethodParameter in Scala 2.13" - {
"should not report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/FeedbackTest.scala b/src/test/scala/com/sksamuel/scapegoat/FeedbackTest.scala
index 7661c66a..f906fdde 100644
--- a/src/test/scala/com/sksamuel/scapegoat/FeedbackTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/FeedbackTest.scala
@@ -20,7 +20,7 @@ class FeedbackTest extends AnyFreeSpec with Matchers with OneInstancePerTest wit
description: String,
explanation: String
) extends Inspection(text, defaultLevel, description, explanation) {
- override def inspector(context: InspectionContext): Inspector = ???
+ override def inspector(ctx: InspectionContext): Inspector = ???
}
"Feedback" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/AnyUseTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/AnyUseTest.scala
index 4c77c5aa..da467370 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/AnyUseTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/AnyUseTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class AnyUseTest extends InspectionTest {
- override val inspections = Seq(new AnyUse)
+ override val inspections = Seq[Inspection](new AnyUse)
"AnyUse" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/AsInstanceOfTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/AsInstanceOfTest.scala
index 6307d545..58642b66 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/AsInstanceOfTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/AsInstanceOfTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.unsafe.AsInstanceOf
class AsInstanceOfTest extends InspectionTest {
- override val inspections = Seq(new AsInstanceOf)
+ override val inspections = Seq[Inspection](new AsInstanceOf)
"AsInstanceOf" - {
"should report warning" in {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/AvoidToMinusOneTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/AvoidToMinusOneTest.scala
index 564f326a..8afa3389 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/AvoidToMinusOneTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/AvoidToMinusOneTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class AvoidToMinusOneTest extends InspectionTest {
- override val inspections = Seq(new AvoidToMinusOne)
+ override val inspections = Seq[Inspection](new AvoidToMinusOne)
"AvoidToMinusOne" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/ConstantIfTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/ConstantIfTest.scala
index 14312116..c36938fd 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/ConstantIfTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/ConstantIfTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.unneccesary.ConstantIf
/** @author Stephen Samuel */
class ConstantIfTest extends InspectionTest {
- override val inspections = Seq(new ConstantIf)
+ override val inspections = Seq[Inspection](new ConstantIf)
"ConstantIf" - {
"should report warning" in {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/DoubleNegationTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/DoubleNegationTest.scala
index 33a13392..f3e51d3d 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/DoubleNegationTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/DoubleNegationTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class DoubleNegationTest extends InspectionTest {
- override val inspections = Seq(new DoubleNegation)
+ override val inspections = Seq[Inspection](new DoubleNegation)
"DoubleNegation" - {
"should report warning" in {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/EitherGetTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/EitherGetTest.scala
index 0bbdbb69..ee984bb7 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/EitherGetTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/EitherGetTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.option.EitherGet
class EitherGetTest extends InspectionTest {
- override val inspections = Seq(new EitherGet)
+ override val inspections = Seq[Inspection](new EitherGet)
"either right / left projection get use" - {
"should report warning" in {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClassTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClassTest.scala
index bfd52e2b..27085fc7 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClassTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/FinalModifierOnCaseClassTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class FinalModifierOnCaseClassTest extends InspectionTest {
- override val inspections = Seq(new FinalModifierOnCaseClass)
+ override val inspections = Seq[Inspection](new FinalModifierOnCaseClass)
private def assertFinalModOnCaseClass(code: String): Unit = {
compileCodeSnippet(code)
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/FinalizerWithoutSuperTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/FinalizerWithoutSuperTest.scala
index 1cf7a8c7..9713e653 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/FinalizerWithoutSuperTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/FinalizerWithoutSuperTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.unsafe.FinalizerWithoutSuper
/** @author Stephen Samuel */
class FinalizerWithoutSuperTest extends InspectionTest {
- override val inspections = Seq(new FinalizerWithoutSuper)
+ override val inspections = Seq[Inspection](new FinalizerWithoutSuper)
"FinalizerWithoutSuper" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/IsInstanceOfTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/IsInstanceOfTest.scala
index 7b026d13..e6483c55 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/IsInstanceOfTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/IsInstanceOfTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.unsafe.IsInstanceOf
/** @author Stephen Samuel */
class IsInstanceOfTest extends InspectionTest {
- override val inspections = Seq(new IsInstanceOf)
+ override val inspections = Seq[Inspection](new IsInstanceOf)
List(1).size
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/LonelySealedTraitTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/LonelySealedTraitTest.scala
index c99e3181..3a6272e8 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/LonelySealedTraitTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/LonelySealedTraitTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class LonelySealedTraitTest extends InspectionTest {
- override val inspections = Seq(new LonelySealedTrait)
+ override val inspections = Seq[Inspection](new LonelySealedTrait)
"LonelySealedTrait" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/MaxParameterTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/MaxParameterTest.scala
index c3910d75..f9c4202b 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/MaxParameterTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/MaxParameterTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class MaxParameterTest extends InspectionTest {
- override val inspections = Seq(new MaxParameters)
+ override val inspections = Seq[Inspection](new MaxParameters)
"MaxParameters" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/MethodReturningAnyTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/MethodReturningAnyTest.scala
index 21d9b7bb..1ba63207 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/MethodReturningAnyTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/MethodReturningAnyTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.inference.MethodReturningAny
/** @author Stephen Samuel */
class MethodReturningAnyTest extends InspectionTest {
- override val inspections = Seq(new MethodReturningAny)
+ override val inspections = Seq[Inspection](new MethodReturningAny)
"MethodReturningAny" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/PublicFinalizerTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/PublicFinalizerTest.scala
index 9f0b264f..904366a3 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/PublicFinalizerTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/PublicFinalizerTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class PublicFinalizerTest extends InspectionTest {
- override val inspections = Seq(new PublicFinalizer)
+ override val inspections = Seq[Inspection](new PublicFinalizer)
"public finalizer" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethodTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethodTest.scala
index 1891a1f3..c885ae78 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethodTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnMethodTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class RedundantFinalModifierOnMethodTest extends InspectionTest {
- override val inspections = Seq(new RedundantFinalModifierOnMethod)
+ override val inspections = Seq[Inspection](new RedundantFinalModifierOnMethod)
"RedundantFinalModifierOnMethod" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVarTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVarTest.scala
index 4c23a930..319c9c5c 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVarTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/RedundantFinalModifierOnVarTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class RedundantFinalModifierOnVarTest extends InspectionTest {
- override val inspections = Seq(new RedundantFinalModifierOnVar)
+ override val inspections = Seq[Inspection](new RedundantFinalModifierOnVar)
"RedundantFinalModifierOnVar" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/TryGetTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/TryGetTest.scala
index ff9a9e56..d168c777 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/TryGetTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/TryGetTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.unsafe.TryGet
/** @author Stephen Samuel */
class TryGetTest extends InspectionTest {
- override val inspections = Seq(new TryGet)
+ override val inspections = Seq[Inspection](new TryGet)
"try.get use" - {
"should report warning" in {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/TypeShadowingTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/TypeShadowingTest.scala
index 72c9c852..3721b1d6 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/TypeShadowingTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/TypeShadowingTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class TypeShadowingTest extends InspectionTest {
- override val inspections = Seq(new TypeShadowing)
+ override val inspections = Seq[Inspection](new TypeShadowing)
"TypeShadowing" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/VarClosureTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/VarClosureTest.scala
index 262a7a9e..db06b91e 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/VarClosureTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/VarClosureTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class VarClosureTest extends InspectionTest {
- override val inspections = Seq(new VarClosure)
+ override val inspections = Seq[Inspection](new VarClosure)
"VarClosure" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/VarCouldBeValTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/VarCouldBeValTest.scala
index 37b0a221..25dca71c 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/VarCouldBeValTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/VarCouldBeValTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.unneccesary.VarCouldBeVal
class VarCouldBeValTest extends InspectionTest {
- override val inspections = Seq(new VarCouldBeVal)
+ override val inspections = Seq[Inspection](new VarCouldBeVal)
"Var could be Val" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/VarUseTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/VarUseTest.scala
index a8330dcf..40f881cc 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/VarUseTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/VarUseTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class VarUseTest extends InspectionTest {
- override val inspections = Seq(new VarUse)
+ override val inspections = Seq[Inspection](new VarUse)
"var keyword use" - {
"should report warning" in {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/VariableShadowingTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/VariableShadowingTest.scala
index f175b137..ff88a40e 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/VariableShadowingTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/VariableShadowingTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class VariableShadowingTest extends InspectionTest {
- override val inspections = Seq(new VariableShadowing)
+ override val inspections = Seq[Inspection](new VariableShadowing)
"VariableShadowing" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/WhileTrueTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/WhileTrueTest.scala
index 044c6c22..79186f9f 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/WhileTrueTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/WhileTrueTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.controlflow.WhileTrue
/** @author Stephen Samuel */
class WhileTrueTest extends InspectionTest {
- override val inspections = Seq(new WhileTrue)
+ override val inspections = Seq[Inspection](new WhileTrue)
"while loop" - {
"when constant" - {
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 1aa28aa2..e1dddc46 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ArrayEqualsTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ArrayEqualsTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class ArrayEqualsTest extends InspectionTest {
- override val inspections = Seq(new ArrayEquals)
+ override val inspections = Seq[Inspection](new ArrayEquals)
"ArrayEquals" - {
"should report warning" - {
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 eb040a37..3e3de708 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeEqualsZeroTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeEqualsZeroTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class AvoidSizeEqualsZeroTest extends InspectionTest {
- override val inspections = Seq(new AvoidSizeEqualsZero)
+ override val inspections = Seq[Inspection](new AvoidSizeEqualsZero)
"collection.size == 0" - {
"should report warning" in {
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 704f3792..3319cd01 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeNotEqualsZeroTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/AvoidSizeNotEqualsZeroTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class AvoidSizeNotEqualsZeroTest extends InspectionTest {
- override val inspections = Seq(new AvoidSizeNotEqualsZero)
+ override val inspections = Seq[Inspection](new AvoidSizeNotEqualsZero)
"collection.size != 0" - {
"should report warning" in {
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 91c66592..3258acf6 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionIndexOnNonIndexedSeqTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionIndexOnNonIndexedSeqTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Josh Rosen */
class CollectionIndexOnNonIndexedSeqTest extends InspectionTest {
- override val inspections = Seq(new CollectionIndexOnNonIndexedSeq)
+ override val inspections = Seq[Inspection](new CollectionIndexOnNonIndexedSeq)
"collection index on non indexed seq" - {
"should report warning" in {
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 50671a28..92f61c0c 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNamingConfusionTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNamingConfusionTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class CollectionNamingConfusionTest extends InspectionTest {
- override val inspections = Seq(new CollectionNamingConfusion)
+ override val inspections = Seq[Inspection](new CollectionNamingConfusion)
"collection confusing names" - {
"should report warning" in {
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 beedeec1..c0c72ee7 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNegativeIndexTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionNegativeIndexTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class CollectionNegativeIndexTest extends InspectionTest {
- override val inspections = Seq(new CollectionNegativeIndex)
+ override val inspections = Seq[Inspection](new CollectionNegativeIndex)
"collection negative index" - {
"should report warning" in {
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 64d5f2d2..e2c721dd 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionPromotionToAnyTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/CollectionPromotionToAnyTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class CollectionPromotionToAnyTest extends InspectionTest {
- override val inspections = Seq(new CollectionPromotionToAny)
+ override val inspections = Seq[Inspection](new CollectionPromotionToAny)
"CollectionPromotionToAny" - {
"should report warning" - {
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 204e68c8..83d1d5c7 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptyListTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptyListTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class ComparisonToEmptyListTest extends InspectionTest {
- override val inspections = Seq(new ComparisonToEmptyList)
+ override val inspections = Seq[Inspection](new ComparisonToEmptyList)
"ComparisonToEmptyList" - {
"should report warning" - {
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 af4143d2..9a6ff69b 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptySetTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ComparisonToEmptySetTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class ComparisonToEmptySetTest extends InspectionTest {
- override val inspections = Seq(new ComparisonToEmptySet)
+ override val inspections = Seq[Inspection](new ComparisonToEmptySet)
"ComparisonToEmptySet" - {
"should report warning" - {
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 3fbbaca0..dec0d75e 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateMapKeyTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateMapKeyTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class DuplicateMapKeyTest extends InspectionTest {
- override val inspections = Seq(new DuplicateMapKey)
+ override val inspections = Seq[Inspection](new DuplicateMapKey)
"DuplicateMapKey" - {
"should report warning" in {
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 9d7460db..e168f27c 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateSetValueTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/DuplicateSetValueTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class DuplicateSetValueTest extends InspectionTest {
- override val inspections = Seq(new DuplicateSetValue)
+ override val inspections = Seq[Inspection](new DuplicateSetValue)
"duplicate set literals" - {
"should report warning" in {
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 f743be2a..fefa46e5 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadOptionTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadOptionTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class FilterDotHeadOptionTest extends InspectionTest {
- override val inspections = Seq(new FilterDotHeadOption)
+ override val inspections = Seq[Inspection](new FilterDotHeadOption)
"self assignment" - {
"should report warning" in {
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 279bb8fc..7fac016a 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotHeadTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class FilterDotHeadTest extends InspectionTest {
- override val inspections = Seq(new FilterDotHead)
+ override val inspections = Seq[Inspection](new FilterDotHead)
"self assignment" - {
"should report warning" in {
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 460abeac..6f73d254 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotIsEmptyTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FilterDotIsEmptyTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class FilterDotIsEmptyTest extends InspectionTest {
- override val inspections = Seq(new FilterDotIsEmpty)
+ override val inspections = Seq[Inspection](new FilterDotIsEmpty)
"self assignment" - {
"should report warning" in {
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 8646f7db..79d3463c 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,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class FilterDotSizeTest extends InspectionTest {
- override val inspections = Seq(new FilterDotSize)
+ override val inspections = Seq[Inspection](new FilterDotSize)
"filter then size" - {
"should report warning" in {
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 d5d2112f..d8988990 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,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class FilterOptionAndGetTest extends InspectionTest {
- override val inspections = Seq(new FilterOptionAndGet)
+ override val inspections = Seq[Inspection](new FilterOptionAndGet)
"filter then size" - {
"should report warning" in {
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 c031e2da..1284e1b0 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExistsTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/FindAndNotEqualsNoneReplaceWithExistsTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class FindAndNotEqualsNoneReplaceWithExistsTest extends InspectionTest {
- override val inspections = Seq(new FindAndNotEqualsNoneReplaceWithExists)
+ override val inspections = Seq[Inspection](new FindAndNotEqualsNoneReplaceWithExists)
"FindAndNotEqualsNoneReplaceWithExists" - {
"should report warning" - {
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 127aa058..febbc1a9 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,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class FindDotIsDefinedTest extends InspectionTest {
- override val inspections = Seq(new FindDotIsDefined)
+ override val inspections = Seq[Inspection](new FindDotIsDefined)
"filter then size" - {
"should report warning" in {
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 8397fd44..668350b9 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,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.{isScala213, InspectionTest}
+import com.sksamuel.scapegoat.{isScala213, Inspection, InspectionTest}
/** @author Stephen Samuel */
class JavaConversionsUseTest extends InspectionTest {
- override val inspections = Seq(new JavaConversionsUse)
+ override val inspections = Seq[Inspection](new JavaConversionsUse)
"JavaConversionsUse" - {
"should report warning (for Scala < 2.13)" in {
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 edad5658..388ccf3d 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ListAppendTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ListAppendTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class ListAppendTest extends InspectionTest {
- override val inspections = Seq(new ListAppend)
+ override val inspections = Seq[Inspection](new ListAppend)
"list.append use" - {
"should report warning" - {
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 ef35b787..0872955a 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ListSizeTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ListSizeTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class ListSizeTest extends InspectionTest {
- override val inspections = Seq(new ListSize)
+ override val inspections = Seq[Inspection](new ListSize)
"list.size use" - {
"should report warning" - {
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 61eb54e1..d19f0c45 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/MapGetAndGetOrElseTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/MapGetAndGetOrElseTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class MapGetAndGetOrElseTest extends InspectionTest {
- override val inspections = Seq(new MapGetAndGetOrElse)
+ override val inspections = Seq[Inspection](new MapGetAndGetOrElse)
private def getOrElseAssertion(code: String): Unit = {
compileCodeSnippet(code)
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 22378f2d..7ffbdf00 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegationIsEmptyTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegationIsEmptyTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class NegationIsEmptyTest extends InspectionTest {
- override val inspections = Seq(new NegationIsEmpty)
+ override val inspections = Seq[Inspection](new NegationIsEmpty)
"!isEmpty" - {
"should report warning" in {
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 4c23fefa..0288f2ab 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegationNonEmptyTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegationNonEmptyTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class NegationNonEmptyTest extends InspectionTest {
- override val inspections = Seq(new NegationNonEmpty)
+ override val inspections = Seq[Inspection](new NegationNonEmpty)
"!nonEmpty" - {
"should report warning" in {
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 243c924b..eecc6ab3 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegativeSeqPadTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/NegativeSeqPadTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class NegativeSeqPadTest extends InspectionTest {
- override val inspections = Seq(new NegativeSeqPad)
+ override val inspections = Seq[Inspection](new NegativeSeqPad)
"self assignment" - {
"should report warning" - {
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 a10b1cbd..291d7eea 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefSeqIsMutableTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefSeqIsMutableTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.{isScala213, InspectionTest}
+import com.sksamuel.scapegoat.{isScala213, Inspection, InspectionTest}
/** @author Stephen Samuel */
class PredefSeqIsMutableTest extends InspectionTest {
- override val inspections = Seq(new PredefSeqIsMutable)
+ override val inspections = Seq[Inspection](new PredefSeqIsMutable)
"PredefSeqUse" - {
"should report warning (for Scala < 2.13)" - {
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 4a98ef68..e41e6061 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefTraversableIsMutableTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PredefTraversableIsMutableTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.{isScala213, InspectionTest}
+import com.sksamuel.scapegoat.{isScala213, Inspection, InspectionTest}
/** @author Stephen Samuel */
class PredefTraversableIsMutableTest extends InspectionTest {
- override val inspections = Seq(new PredefTraversableIsMutable)
+ override val inspections = Seq[Inspection](new PredefTraversableIsMutable)
"PredefTraversableIsMutable" - {
"should report warning (for Scala < 2.13)" - {
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 fae219dc..79259b8b 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmptyTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferMapEmptyTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class PreferMapEmptyTest extends InspectionTest {
- override val inspections = Seq(new PreferMapEmpty)
+ override val inspections = Seq[Inspection](new PreferMapEmpty)
"should report warning" - {
"with map apply" in {
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 e6d9e033..65712f7a 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferSeqEmptyTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferSeqEmptyTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class PreferSeqEmptyTest extends InspectionTest {
- override val inspections = Seq(new PreferSeqEmpty)
+ override val inspections = Seq[Inspection](new PreferSeqEmpty)
"should report warning" - {
"with empty seq apply" in {
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 c2aad784..c7d28f34 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferSetEmptyTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/PreferSetEmptyTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class PreferSetEmptyTest extends InspectionTest {
- override val inspections = Seq(new PreferSetEmpty)
+ override val inspections = Seq[Inspection](new PreferSetEmpty)
"set apply" - {
"should report warning" in {
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 8c4f1b5b..9a8d66b1 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseFuncTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseFuncTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class ReverseFuncTest extends InspectionTest {
- override val inspections = Seq(new ReverseFunc)
+ override val inspections = Seq[Inspection](new ReverseFunc)
"ReverseFunc" - {
"should report warning" in {
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 44719561..984f5bf1 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTailReverseTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTailReverseTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class ReverseTailReverseTest extends InspectionTest {
- override val inspections = Seq(new ReverseTailReverse)
+ override val inspections = Seq[Inspection](new ReverseTailReverse)
"ReverseTailReverse" - {
"should report warning" in {
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 772877c1..bdbe2948 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTakeReverseTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/ReverseTakeReverseTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class ReverseTakeReverseTest extends InspectionTest {
- override val inspections = Seq(new ReverseTakeReverse)
+ override val inspections = Seq[Inspection](new ReverseTakeReverse)
"ReverseTakeReverse" - {
"should report warning" in {
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 86411292..33d6441e 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/SwapSortFilterTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/SwapSortFilterTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class SwapSortFilterTest extends InspectionTest {
- override val inspections = Seq(new SwapSortFilter)
+ override val inspections = Seq[Inspection](new SwapSortFilter)
"sort then filter" - {
"should report warning" in {
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 4235a4ba..66bc5e3f 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeContainsTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeContainsTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class UnsafeContainsTest extends InspectionTest {
- override val inspections = Seq(new UnsafeContains)
+ override val inspections = Seq[Inspection](new UnsafeContains)
"unsafe contains" - {
"should report warning" in {
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 08268197..a4fd275b 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeTraversableMethodsTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/collections/UnsafeTraversableMethodsTest.scala
@@ -1,10 +1,10 @@
package com.sksamuel.scapegoat.inspections.collections
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class UnsafeTraversableMethodsTest extends InspectionTest {
- override val inspections = Seq(new UnsafeTraversableMethods)
+ override val inspections = Seq[Inspection](new UnsafeTraversableMethods)
val unsafeMethodUsages = Set(
"head",
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 8e1133c7..da284f26 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBodyTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/controlflow/RepeatedIfElseBodyTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.controlflow
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class RepeatedIfElseBodyTest extends InspectionTest {
- override val inspections = Seq(new RepeatedIfElseBody)
+ override val inspections = Seq[Inspection](new RepeatedIfElseBody)
"repeated if else body" - {
"should report warning" - {
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 706334a5..2a464aa3 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyCaseClassTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyCaseClassTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections.empty
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.EmptyCaseClass
/** @author Stephen Samuel */
class EmptyCaseClassTest extends InspectionTest {
- override val inspections = Seq(new EmptyCaseClass)
+ override val inspections = Seq[Inspection](new EmptyCaseClass)
"empty class classes" - {
"should report warning" - {
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 5b40983d..b9ac0f9a 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyForTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyForTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.empty
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class EmptyForTest extends InspectionTest {
- override val inspections = Seq(new EmptyFor)
+ override val inspections = Seq[Inspection](new EmptyFor)
"EmptyFor" - {
"should report warning" in {
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 e3757b71..bcb37d9a 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyIfBlockTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyIfBlockTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.empty
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class EmptyIfBlockTest extends InspectionTest {
- override val inspections = Seq(new EmptyIfBlock)
+ override val inspections = Seq[Inspection](new EmptyIfBlock)
"empty if block" - {
"should report warning" in {
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 64bc9dc8..5fea6eea 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyMethodTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyMethodTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.empty
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class EmptyMethodTest extends InspectionTest {
- override val inspections = Seq(new EmptyMethod)
+ override val inspections = Seq[Inspection](new EmptyMethod)
"empty method" - {
"should report warning" in {
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 c54d287f..74c03297 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,11 @@
package com.sksamuel.scapegoat.inspections.empty
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class EmptySynchronizedBlockTest extends InspectionTest {
- override val inspections = Seq(new EmptySynchronizedBlock)
+ override val inspections = Seq[Inspection](new EmptySynchronizedBlock)
"empty empty" - {
"should report warning" in {
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 ec0c9251..faa1b560 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyTryBlockTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyTryBlockTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.empty
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class EmptyTryBlockTest extends InspectionTest {
- override val inspections = Seq(new EmptyTryBlock)
+ override val inspections = Seq[Inspection](new EmptyTryBlock)
"empty try block" - {
"should report warning" in {
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 e5a56190..98b3c9e4 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyWhileBlockTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/empty/EmptyWhileBlockTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.empty
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class EmptyWhileBlockTest extends InspectionTest {
- override val inspections = Seq(new EmptyWhileBlock)
+ override val inspections = Seq[Inspection](new EmptyWhileBlock)
"empty while block" - {
"should report warning" in {
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 a9c9ef68..a5682588 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,12 @@
package com.sksamuel.scapegoat.inspections.empty
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.unneccesary.RedundantFinalizer
/** @author Stephen Samuel */
class RedundantFinalizerTest extends InspectionTest {
- override val inspections = Seq(new RedundantFinalizer)
+ override val inspections = Seq[Inspection](new RedundantFinalizer)
"redundant finalizer" - {
"should report warning" in {
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 9ce35073..5bedec2a 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparingFloatingPointTypesTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/equality/ComparingFloatingPointTypesTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.equality
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class ComparingFloatingPointTypesTest extends InspectionTest {
- override val inspections = Seq(new ComparingFloatingPointTypes)
+ override val inspections = Seq[Inspection](new ComparingFloatingPointTypes)
"comparing floating type inspection" - {
"should report warning" - {
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 cb202fe3..af78c441 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,11 @@
package com.sksamuel.scapegoat.inspections.equality
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class ComparisonWithSelfInspectionTest extends InspectionTest {
- override val inspections = Seq(new ComparisonWithSelf)
+ override val inspections = Seq[Inspection](new ComparisonWithSelf)
"ComparisonWithSelf" - {
"should report warning" in {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionImmediatelyRethrownTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionImmediatelyRethrownTest.scala
index 9a753a2b..54e088ff 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionImmediatelyRethrownTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionImmediatelyRethrownTest.scala
@@ -1,10 +1,10 @@
package com.sksamuel.scapegoat.inspections.exception
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class CatchExceptionImmediatelyRethrownTest extends InspectionTest {
- override val inspections = Seq(new CatchExceptionImmediatelyRethrown)
+ override val inspections = Seq[Inspection](new CatchExceptionImmediatelyRethrown)
"catch exception immediately throw" - {
"should report warning" in {
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 1d1aba3e..7dc08704 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchExceptionTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.exception
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Marconi Lanna */
class CatchExceptionTest extends InspectionTest {
- override val inspections = Seq(new CatchException)
+ override val inspections = Seq[Inspection](new CatchException)
"catch _ exception" - {
"should report warning" in {
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 2cc80878..3629f56c 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchFatalTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchFatalTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.exception
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Marconi Lanna */
class CatchFatalTest extends InspectionTest {
- override val inspections = Seq(new CatchFatal)
+ override val inspections = Seq[Inspection](new CatchFatal)
"catch _ fatal exception" - {
"should report warning" in {
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 090b6874..575f5c4c 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchNpeTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchNpeTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.exception
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class CatchNpeTest extends InspectionTest {
- override val inspections = Seq(new CatchNpe)
+ override val inspections = Seq[Inspection](new CatchNpe)
"catching null pointer exception" - {
"should report warning" in {
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 90c8fbd0..7891e36f 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchThrowableTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/CatchThrowableTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.exception
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class CatchThrowableTest extends InspectionTest {
- override val inspections = Seq(new CatchThrowable)
+ override val inspections = Seq[Inspection](new CatchThrowable)
"catch _ throwable" - {
"should report warning" in {
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 46983e13..42cabc94 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/IncorrectlyNamedExceptionsTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/IncorrectlyNamedExceptionsTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.exception
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class IncorrectlyNamedExceptionsTest extends InspectionTest {
- override val inspections = Seq(new IncorrectlyNamedExceptions)
+ override val inspections = Seq[Inspection](new IncorrectlyNamedExceptions)
"incorrectly named exceptions" - {
"should report warning" in {
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 2d057816..38908cc4 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/SwallowedExceptionTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/SwallowedExceptionTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.exception
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class SwallowedExceptionTest extends InspectionTest {
- override val inspections = Seq(new SwallowedException)
+ override val inspections = Seq[Inspection](new SwallowedException)
"SwallowedException" - {
"should report warning" - {
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 63a08d6b..977c035f 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/exception/UnreachableCatchTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/exception/UnreachableCatchTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.exception
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class UnreachableCatchTest extends InspectionTest {
- override val inspections = Seq(new UnreachableCatch)
+ override val inspections = Seq[Inspection](new UnreachableCatch)
"unreachable catch" - {
"should report warning" - {
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 86094e80..72b39de2 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/imports/DuplicateImportTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/imports/DuplicateImportTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.imports
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class DuplicateImportTest extends InspectionTest {
- override val inspections = Seq(new DuplicateImport)
+ override val inspections = Seq[Inspection](new DuplicateImport)
"DuplicatedImport" - {
"should report warning" - {
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 6178bd59..2405f6bf 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/imports/WildcardImportTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/imports/WildcardImportTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.imports
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class WildcardImportTest extends InspectionTest {
- override val inspections = Seq(new WildcardImport)
+ override val inspections = Seq[Inspection](new WildcardImport)
"WildcardImport" - {
"should report warning" - {
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 172b9acb..d459a751 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/BoundedByFinalTypeTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/BoundedByFinalTypeTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections.inferrence
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.inference.BoundedByFinalType
/** @author Stephen Samuel */
class BoundedByFinalTypeTest extends InspectionTest {
- override val inspections = Seq(new BoundedByFinalType)
+ override val inspections = Seq[Inspection](new BoundedByFinalType)
"BoundedByFinalType" - {
"should report warning" - {
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 e64769fc..eee635cc 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/PointlessTypeBoundsTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/inferrence/PointlessTypeBoundsTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections.inferrence
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.inference.PointlessTypeBounds
/** @author Stephen Samuel */
class PointlessTypeBoundsTest extends InspectionTest {
- override val inspections = Seq(new PointlessTypeBounds)
+ override val inspections = Seq[Inspection](new PointlessTypeBounds)
"PointlessTypeBounds" - {
"should report warning" - {
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 6cc00256..28049930 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,12 @@
package com.sksamuel.scapegoat.inspections.inferrence
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.inference.ProductWithSerializableInferred
/** @author Stephen Samuel */
class ProductWithSerializableInferredTest extends InspectionTest {
- override val inspections = Seq(new ProductWithSerializableInferred)
+ override val inspections = Seq[Inspection](new ProductWithSerializableInferred)
"when Product with Serializable is inferred" - {
"should report warning" in {
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 98e8b30a..7fe3d722 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/matching/RepeatedCaseBodyTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/matching/RepeatedCaseBodyTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.matching
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class RepeatedCaseBodyTest extends InspectionTest {
- override val inspections = Seq(new RepeatedCaseBody)
+ override val inspections = Seq[Inspection](new RepeatedCaseBody)
"repeated case bodies" - {
"should report warning" - {
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 993d7cbf..497777fc 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/matching/SuspiciousMatchOnClassObjectTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/matching/SuspiciousMatchOnClassObjectTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.matching
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class SuspiciousMatchOnClassObjectTest extends InspectionTest {
- override val inspections = Seq(new SuspiciousMatchOnClassObject)
+ override val inspections = Seq[Inspection](new SuspiciousMatchOnClassObject)
"SuspiciousMatchOnClassObject" - {
"should report warning" - {
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 06146fb0..587f67e1 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalDoubleConstructorTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalDoubleConstructorTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.math
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class BigDecimalDoubleConstructorTest extends InspectionTest {
- override val inspections = Seq(new BigDecimalDoubleConstructor)
+ override val inspections = Seq[Inspection](new BigDecimalDoubleConstructor)
"big decimal double constructor" - {
"should report warning" in {
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 5a6b4ef8..816ff070 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalScaleWithoutRoundingModeTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/BigDecimalScaleWithoutRoundingModeTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.math
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class BigDecimalScaleWithoutRoundingModeTest extends InspectionTest {
- override val inspections = Seq(new BigDecimalScaleWithoutRoundingMode)
+ override val inspections = Seq[Inspection](new BigDecimalScaleWithoutRoundingMode)
"BigDecimalScaleWithoutRoundingMode" - {
"should report warning" - {
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 2a98cde0..6fd4e786 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,11 @@
package com.sksamuel.scapegoat.inspections.math
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class BrokenOddnessTest extends InspectionTest {
- override val inspections = Seq(new BrokenOddness)
+ override val inspections = Seq[Inspection](new BrokenOddness)
"broken odd use" - {
"should report warning" in {
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 a01de8ff..d9acacaa 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/DivideByOneTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/DivideByOneTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.math
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class DivideByOneTest extends InspectionTest {
- override val inspections = Seq(new DivideByOne)
+ override val inspections = Seq[Inspection](new DivideByOne)
"divide by one" - {
"for int" - {
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 d786078b..df3f1cb0 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,11 @@
package com.sksamuel.scapegoat.inspections.math
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class ModOneTest extends InspectionTest {
- override val inspections = Seq(new ModOne)
+ override val inspections = Seq[Inspection](new ModOne)
"mod one use" - {
"should report warning" in {
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 c32bd832..4c64c0d8 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/NanComparisonTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/NanComparisonTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.math
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class NanComparisonTest extends InspectionTest {
- override val inspections = Seq(new NanComparison)
+ override val inspections = Seq[Inspection](new NanComparison)
"nan comparison" - {
"should report warning" - {
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 df23c1a7..f8937fbd 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,11 @@
package com.sksamuel.scapegoat.inspections.math
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Matic Potočnik */
class UseCbrtTest extends InspectionTest {
- override val inspections = Seq(new UseCbrt)
+ override val inspections = Seq[Inspection](new UseCbrt)
"using pow instead of cbrt" - {
"should report warning" in {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseExpM1Test.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseExpM1Test.scala
index 201094d6..1752151e 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseExpM1Test.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseExpM1Test.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.math
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Matic Potočnik */
class UseExpM1Test extends InspectionTest {
- override val inspections = Seq(new UseExpM1)
+ override val inspections = Seq[Inspection](new UseExpM1)
"using exp(x) - 1 instead of expm1(x)" - {
"should report warning" in {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseLog10Test.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseLog10Test.scala
index b9902687..b055f7ac 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseLog10Test.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseLog10Test.scala
@@ -1,10 +1,10 @@
package com.sksamuel.scapegoat.inspections.math
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class UseLog10Test extends InspectionTest {
- override val inspections = Seq(new UseLog10)
+ override val inspections = Seq[Inspection](new UseLog10)
"using log(x)/log(10) instead of log10(x)" - {
"should report warning" in {
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 e7e48522..3fcf6f14 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseLog1PTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseLog1PTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.math
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class UseLog1PTest extends InspectionTest {
- override val inspections = Seq(new UseLog1P)
+ override val inspections = Seq[Inspection](new UseLog1P)
"using log(x + 1) instead of log1p(x)" - {
"should report warning" in {
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 305fcbe1..4d588357 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseSqrtTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/UseSqrtTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.math
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class UseSqrtTest extends InspectionTest {
- override val inspections = Seq(new UseSqrt)
+ override val inspections = Seq[Inspection](new UseSqrt)
"using pow instead of sqrt" - {
"should report warning" in {
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 c6bbc5e3..e2071aec 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/math/ZeroNumeratorTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/math/ZeroNumeratorTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.math
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class ZeroNumeratorTest extends InspectionTest {
- override val inspections = Seq(new ZeroNumerator)
+ override val inspections = Seq[Inspection](new ZeroNumerator)
"zero numerator" - {
"should report warning" - {
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 abc8b9c4..0b5fab2d 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/names/ClassNamesTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/names/ClassNamesTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections.names
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.naming.ClassNames
/** @author Stephen Samuel */
class ClassNamesTest extends InspectionTest {
- override val inspections = Seq(new ClassNames)
+ override val inspections = Seq[Inspection](new ClassNames)
"ClassNames" - {
"should report warning" - {
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 08ba4658..f3579df6 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/names/MethodNamesTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/names/MethodNamesTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections.names
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.naming.MethodNames
/** @author Stephen Samuel */
class MethodNamesTest extends InspectionTest {
- override val inspections = Seq(new MethodNames)
+ override val inspections = Seq[Inspection](new MethodNames)
"MethodNames" - {
"should report warning" - {
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 cccadc9b..9c6f5475 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/names/ObjectNamesTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/names/ObjectNamesTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections.names
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.naming.ObjectNames
/** @author Stephen Samuel */
class ObjectNamesTest extends InspectionTest {
- override val inspections = Seq(new ObjectNames)
+ override val inspections = Seq[Inspection](new ObjectNames)
"ObjectNames" - {
"should report warning" - {
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 0c15b159..d42cecbe 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/nulls/NullAssignmentTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/nulls/NullAssignmentTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.nulls
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class NullAssignmentTest extends InspectionTest {
- override val inspections = Seq(new NullAssignment)
+ override val inspections = Seq[Inspection](new NullAssignment)
"NullAssignment" - {
"should report warning" - {
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 cdca2ab2..0d101ec5 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/nulls/NullParameterTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/nulls/NullParameterTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.nulls
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class NullParameterTest extends InspectionTest {
- override val inspections = Seq(new NullParameter)
+ override val inspections = Seq[Inspection](new NullParameter)
"NullParameter" - {
"should report warning" - {
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 a921f03c..89110d88 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/option/ImpossibleOptionSizeConditionTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/option/ImpossibleOptionSizeConditionTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.option
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class ImpossibleOptionSizeConditionTest extends InspectionTest {
- override val inspections = Seq(new ImpossibleOptionSizeCondition)
+ override val inspections = Seq[Inspection](new ImpossibleOptionSizeCondition)
"options.size > x where x is > 1" - {
"should report warning" in {
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 839a7d1b..aae0e242 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,11 @@
package com.sksamuel.scapegoat.inspections.option
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class OptionGetTest extends InspectionTest {
- override val inspections = Seq(new OptionGet)
+ override val inspections = Seq[Inspection](new OptionGet)
"option.get use" - {
"should report warning" in {
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 de446aad..4e0b7848 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,11 @@
package com.sksamuel.scapegoat.inspections.option
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class OptionSizeTest extends InspectionTest {
- override val inspections = Seq(new OptionSize)
+ override val inspections = Seq[Inspection](new OptionSize)
"option.size use" - {
"should report warning" in {
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 55dcefac..0e2955d4 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/ArraysInFormatTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/ArraysInFormatTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.string
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class ArraysInFormatTest extends InspectionTest {
- override val inspections = Seq(new ArraysInFormat)
+ override val inspections = Seq[Inspection](new ArraysInFormat)
"use of array in format" - {
"should report warning" in {
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 8d755cdd..95f552a0 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/ArraysToStringTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/ArraysToStringTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.string
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class ArraysToStringTest extends InspectionTest {
- override val inspections = Seq(new ArraysToString)
+ override val inspections = Seq[Inspection](new ArraysToString)
"ArraysToString" - {
"should report warning" - {
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 b161ee7b..d0c08ab1 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/EmptyInterpolatedStringTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/EmptyInterpolatedStringTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.string
-import com.sksamuel.scapegoat.{isScala213, InspectionTest}
+import com.sksamuel.scapegoat.{isScala213, Inspection, InspectionTest}
/** @author Stephen Samuel */
class EmptyInterpolatedStringTest extends InspectionTest {
- override val inspections = Seq(new EmptyInterpolatedString)
+ override val inspections = Seq[Inspection](new EmptyInterpolatedString)
"EmptyInterpolatedString" - {
"should report warning (for Scala < 2.13)" in {
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 4330b0aa..12840a31 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/IllegalFormatStringTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/IllegalFormatStringTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.string
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class IllegalFormatStringTest extends InspectionTest {
- override val inspections = Seq(new IllegalFormatString)
+ override val inspections = Seq[Inspection](new IllegalFormatString)
"unknown conversion type" - {
"should report warning" in {
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 38e34741..530f304a 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/IncorrectNumberOfArgsToFormatTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/IncorrectNumberOfArgsToFormatTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.string
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class IncorrectNumberOfArgsToFormatTest extends InspectionTest {
- override val inspections = Seq(new IncorrectNumberOfArgsToFormat)
+ override val inspections = Seq[Inspection](new IncorrectNumberOfArgsToFormat)
"IncorrectNumberOfArgsToFormat" - {
"should report warning" in {
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 90945d49..4caaedb9 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/InvalidRegexTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/InvalidRegexTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.string
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class InvalidRegexTest extends InspectionTest {
- override val inspections = Seq(new InvalidRegex)
+ override val inspections = Seq[Inspection](new InvalidRegex)
"invalid regex" - {
"should report warning" in {
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 ae3a10c4..06079908 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedStringTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/LooksLikeInterpolatedStringTest.scala
@@ -1,9 +1,9 @@
package com.sksamuel.scapegoat.inspections.string
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
class LooksLikeInterpolatedStringTest extends InspectionTest {
- override val inspections = Seq(new LooksLikeInterpolatedString)
+ override val inspections = Seq[Inspection](new LooksLikeInterpolatedString)
"LooksLikeInterpolatedString" - {
"should report warning" - {
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 7c540b9f..c5e7807b 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/StripMarginOnRegexTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/StripMarginOnRegexTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.string
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class StripMarginOnRegexTest extends InspectionTest {
- override val inspections = Seq(new StripMarginOnRegex)
+ override val inspections = Seq[Inspection](new StripMarginOnRegex)
"StripMarginOnRegex" - {
"should report warning" - {
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 79e49422..5f739ff9 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/SubstringZeroTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/SubstringZeroTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.string
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class SubstringZeroTest extends InspectionTest {
- override val inspections = Seq(new SubstringZero)
+ override val inspections = Seq[Inspection](new SubstringZero)
"String.substring(0)" - {
"should report warning" in {
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 488f29d8..dacd0ade 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/string/UnsafeStringContainsTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/string/UnsafeStringContainsTest.scala
@@ -1,10 +1,10 @@
package com.sksamuel.scapegoat.inspections.string
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Zack Grannan */
class UnsafeStringContainsTest extends InspectionTest {
- override val inspections = Seq(new UnsafeStringContains)
+ override val inspections = Seq[Inspection](new UnsafeStringContains)
"unsafe string contains" - {
"should report warning" in {
val code =
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 c081a5e7..1d15ae36 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/style/AvoidOperatorOverloadTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/style/AvoidOperatorOverloadTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.style
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class AvoidOperatorOverloadTest extends InspectionTest {
- override val inspections = Seq(new AvoidOperatorOverload)
+ override val inspections = Seq[Inspection](new AvoidOperatorOverload)
"AvoidOperatorOverload" - {
"should report warning" - {
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 3e727f78..3a377b3e 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/style/ParameterlessMethodReturnsUnitTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/style/ParameterlessMethodReturnsUnitTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.style
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class ParameterlessMethodReturnsUnitTest extends InspectionTest {
- override val inspections = Seq(new ParameterlessMethodReturnsUnit)
+ override val inspections = Seq[Inspection](new ParameterlessMethodReturnsUnit)
"ParameterlessMethodReturnsUnit" - {
"should report warning" - {
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 037ee27f..c586f6c9 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,11 @@
package com.sksamuel.scapegoat.inspections.style
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
/** @author Stephen Samuel */
class SimplifyBooleanExpressionTest extends InspectionTest {
- override val inspections = Seq(new SimplifyBooleanExpression)
+ override val inspections = Seq[Inspection](new SimplifyBooleanExpression)
"incorrectly named exceptions" - {
"should report warning" in {
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 e652991e..e7ef6630 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/NoOpOverrideTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/NoOpOverrideTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections.unnecessary
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.NoOpOverride
/** @author Stephen Samuel */
class NoOpOverrideTest extends InspectionTest {
- override val inspections = Seq(new NoOpOverride)
+ override val inspections = Seq[Inspection](new NoOpOverride)
"UnnecessaryOverride" - {
"should report warning" - {
diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/StoreBeforeReturnTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/StoreBeforeReturnTest.scala
index 081c23a0..ac74eda9 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/StoreBeforeReturnTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/StoreBeforeReturnTest.scala
@@ -1,11 +1,11 @@
package com.sksamuel.scapegoat.inspections.unnecessary
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.unneccesary.StoreBeforeReturn
class StoreBeforeReturnTest extends InspectionTest {
- override val inspections = Seq(new StoreBeforeReturn)
+ override val inspections = Seq[Inspection](new StoreBeforeReturn)
"store value before explicit return" - {
"should report warning" in {
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 07ba47a3..65d36deb 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryConversionTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryConversionTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections.unnecessary
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.unneccesary.UnnecessaryConversion
/** @author Stephen Samuel */
class UnnecessaryConversionTest extends InspectionTest {
- override val inspections = Seq(new UnnecessaryConversion)
+ override val inspections = Seq[Inspection](new UnnecessaryConversion)
"Unnecessary conversion" - {
"should report warning" - {
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 aa185fb2..92992aac 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryIfTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnnecessaryIfTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections.unnecessary
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.unneccesary.UnnecessaryIf
/** @author Stephen Samuel */
class UnnecessaryIfTest extends InspectionTest {
- override val inspections = Seq(new UnnecessaryIf)
+ override val inspections = Seq[Inspection](new UnnecessaryIf)
"unncessary if" - {
"should report warning" in {
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 bb944100..7e761160 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,12 @@
package com.sksamuel.scapegoat.inspections.unnecessary
-import com.sksamuel.scapegoat.InspectionTest
+import com.sksamuel.scapegoat.{Inspection, InspectionTest}
import com.sksamuel.scapegoat.inspections.unneccesary.UnnecessaryReturnUse
/** @author Stephen Samuel */
class UnnecessaryReturnUseTest extends InspectionTest {
- override val inspections = Seq(new UnnecessaryReturnUse)
+ override val inspections = Seq[Inspection](new UnnecessaryReturnUse)
"return keyword use" - {
"should report warning" in {
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 59c2fb46..35e226a1 100644
--- a/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnusedMethodParameterTest.scala
+++ b/src/test/scala/com/sksamuel/scapegoat/inspections/unnecessary/UnusedMethodParameterTest.scala
@@ -1,12 +1,12 @@
package com.sksamuel.scapegoat.inspections.unnecessary
import com.sksamuel.scapegoat.inspections.unneccesary.UnusedMethodParameter
-import com.sksamuel.scapegoat.{InspectionTest, Warning}
+import com.sksamuel.scapegoat.{Inspection, InspectionTest, Warning}
/** @author Stephen Samuel */
class UnusedMethodParameterTest extends InspectionTest {
- override val inspections = Seq(new UnusedMethodParameter)
+ override val inspections = Seq[Inspection](new UnusedMethodParameter)
"UnusedMethodParameter" - {
"should report warning" - {