Skip to content

Commit

Permalink
Another scalafmt (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
mccartney authored Jun 17, 2020
1 parent f42e9ea commit 5750a81
Show file tree
Hide file tree
Showing 105 changed files with 207 additions and 106 deletions.
3 changes: 2 additions & 1 deletion src/main/scala/com/sksamuel/scapegoat/Feedback.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import scala.collection.mutable.ListBuffer
import scala.reflect.internal.util.Position
import scala.tools.nsc.reporters.Reporter

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class Feedback(
consoleOutput: Boolean,
reporter: Reporter,
Expand Down
3 changes: 2 additions & 1 deletion src/main/scala/com/sksamuel/scapegoat/Inspection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package com.sksamuel.scapegoat
import scala.reflect.internal.util.Position
import scala.tools.nsc.Global

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
abstract class Inspection(
val text: String,
val defaultLevel: Level,
Expand Down
3 changes: 2 additions & 1 deletion src/main/scala/com/sksamuel/scapegoat/Level.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sksamuel.scapegoat

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
sealed trait Level

object Levels {
Expand Down
3 changes: 2 additions & 1 deletion src/main/scala/com/sksamuel/scapegoat/ScapegoatConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import com.sksamuel.scapegoat.inspections.style._
import com.sksamuel.scapegoat.inspections.unneccesary._
import com.sksamuel.scapegoat.inspections.unsafe._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
object ScapegoatConfig extends App {

def inspections: Seq[Inspection] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import scala.reflect.internal.Flags

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class AnyUse
extends Inspection(
text = "Use of Any",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import scala.runtime.{RichInt, RichLong}

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class AvoidToMinusOne
extends Inspection(
text = "Avoid (j to k - 1)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class DoubleNegation
extends Inspection(
text = "Double negation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class EmptyCaseClass
extends Inspection(
text = "Empty case class",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import scala.collection.mutable

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class LonelySealedTrait
extends Inspection(
text = "Lonely sealed trait",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class MaxParameters
extends Inspection(
text = "Max parameters",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class NoOpOverride
extends Inspection(
text = "Noop override",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class PublicFinalizer
extends Inspection(
text = "PublicFinalizer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import scala.collection.mutable

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class TypeShadowing
extends Inspection(
text = "Type shadowing",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class VarClosure
extends Inspection(
text = "Var in closure",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class ArrayEquals
extends Inspection(
text = "Array equals",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class AvoidSizeEqualsZero
extends Inspection(
text = "Avoid Traversable.size == 0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class AvoidSizeNotEqualsZero
extends Inspection(
text = "Avoid Traversable.size != 0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Josh Rosen */
/**
* @author Josh Rosen */
class CollectionIndexOnNonIndexedSeq
extends Inspection(
text = "Use of apply method on a non-indexed Seq",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class CollectionNamingConfusion
extends Inspection(
text = "Collection naming confusion",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class CollectionNegativeIndex
extends Inspection(
text = "Collection index out of bounds",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class ComparisonToEmptyList
extends Inspection(
text = "Comparison to empty list",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class ComparisonToEmptySet
extends Inspection(
text = "Comparison to empty set",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class DuplicateMapKey
extends Inspection(
text = "Duplicated map key",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class DuplicateSetValue
extends Inspection(
text = "Duplicated set value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class FilterDotHead
extends Inspection(
text = "filter().head can throw an exception",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class FilterDotHeadOption
extends Inspection(
text = "filter().headOption instead of find()",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class FilterDotIsEmpty
extends Inspection(
text = "filter().isEmpty instead of !exists()",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class FilterOptionAndGet
extends Inspection(
text = "filter(_.isDefined).map(_.get) instead of flatten",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class FindDotIsDefined
extends Inspection(
text = "find().isDefined() instead of exists()",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class JavaConversionsUse
extends Inspection(
text = "Java conversions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class ListAppend
extends Inspection(
text = "List append is slow",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class ListSize
extends Inspection(
text = "List.size is O(n)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class NegationIsEmpty
extends Inspection(
text = "!isEmpty can be replaced with nonEmpty",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class NegationNonEmpty
extends Inspection(
text = "!nonEmpty can be replaced with isEmpty",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class NegativeSeqPad
extends Inspection(
text = "Negative seq padTo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class PredefIterableIsMutable
extends Inspection(
text = "Default Iterable is mutable",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class PredefSeqIsMutable
extends Inspection(
text = "Predef.Seq is mutable",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat.{Inspection, InspectionContext, Inspector, Levels}

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class PredefTraversableIsMutable
extends Inspection(
text = "Traversable is mutable",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class PreferSeqEmpty
extends Inspection(
text = "Prefer Seq.empty",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.sksamuel.scapegoat.inspections.collections

import com.sksamuel.scapegoat._

/** @author Stephen Samuel */
/**
* @author Stephen Samuel */
class PreferSetEmpty
extends Inspection(
text = "Prefer Set.empty",
Expand Down
Loading

0 comments on commit 5750a81

Please sign in to comment.