From 5bd0b7af111227862e6775b1183d11890632c5b0 Mon Sep 17 00:00:00 2001 From: Michael Wizner Date: Sat, 28 Mar 2020 23:56:02 +0000 Subject: [PATCH] Add a description to asInstanceOf. --- .../com/sksamuel/scapegoat/inspections/math/UseLog1P.scala | 2 +- .../com/sksamuel/scapegoat/inspections/option/OptionGet.scala | 2 +- .../sksamuel/scapegoat/inspections/unsafe/AsInstanceOf.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 631a57cb..15426da2 100644 --- a/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseLog1P.scala +++ b/src/main/scala/com/sksamuel/scapegoat/inspections/math/UseLog1P.scala @@ -6,7 +6,7 @@ class UseLog1P extends Inspection( text = "Use log1p", defaultLevel = Levels.Info, - description = "Checks for use of math.log(x + 1) instead of math.log1p(x)", + description = "Checks for use of math.log(x + 1) instead of math.log1p(x).", explanation = "Use math.log1p(x) is clearer and more performant than $math.log(1 + x)." ) { 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 cd66dd2b..39c65f52 100644 --- a/src/main/scala/com/sksamuel/scapegoat/inspections/option/OptionGet.scala +++ b/src/main/scala/com/sksamuel/scapegoat/inspections/option/OptionGet.scala @@ -7,7 +7,7 @@ class OptionGet extends Inspection( text = "Use of Option.get", defaultLevel = Levels.Error, - description = "Checks for use of Option.get", + description = "Checks for use of Option.get.", explanation = "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." ) { 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 13977765..c932df4b 100644 --- a/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/AsInstanceOf.scala +++ b/src/main/scala/com/sksamuel/scapegoat/inspections/unsafe/AsInstanceOf.scala @@ -6,7 +6,7 @@ class AsInstanceOf extends Inspection( text = "Use of asInstanceOf", defaultLevel = Levels.Warning, - description = "", + description = "Checks for use of asInstanceOf.", explanation = "Use of asInstanceOf is considered a bad practice - consider using pattern matching instead." ) {