Skip to content

Commit

Permalink
Alternative way to enable fill file path names in scalactic
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Saksin committed Mar 18, 2020
1 parent 4e1e38e commit 37f9fa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Expand Up @@ -57,7 +57,7 @@ notValidPosZFloat=PosZFloat.apply can only be invoked on a non-negative (n >= 0.
notLiteralPosZFloat=PosZFloat.apply can only be invoked on a floating point literal, like PosZFloat(42.0F). Please use PosZFloat.from instead.
notValidPosZDouble=PosZDouble.apply can only be invoked on a non-negative (n >= 0.0 && !n.isNaN) floating point literal, like PosZDouble(42.0).
notLiteralPosZDouble=PosZDouble.apply can only be invoked on a floating point literal, like PosZDouble(42.0). Please use PosZDouble.from instead.
pleaseDefineScalacticFillFilePathnameEnvVar=Please set the environment variable SCALACTIC_FILL_FILE_PATHNAMES to yes at compile time to enable this feature.
pleaseDefineScalacticFillFilePathnameEnvVar=Please set the environment variable SCALACTIC_FILL_FILE_PATHNAMES (or property scalactic.fillFilePathnames) to yes at compile time to enable this feature.
notValidNonZeroInt=NonZeroInt.apply can only be invoked on a non-zero (n != 0) integer literal, like NonZeroInt(42).
notLiteralNonZeroInt=NonZeroInt.apply can only be invoked on an integer literal, like NonZeroInt(42). Please use NonZeroInt.from instead.
notValidNonZeroLong=NonZeroLong.apply can only be invoked on a non-zero (n != 0L) long literal, like NonZeroLong(42L).
Expand Down
Expand Up @@ -28,8 +28,11 @@ object PositionMacro {
import sourceCompatHack._

private[scalactic] lazy val showScalacticFillFilePathnames: Boolean = {
val value = System.getenv("SCALACTIC_FILL_FILE_PATHNAMES")
value != null && value == "yes"
val enabledThroughEnv = System.getenv("SCALACTIC_FILL_FILE_PATHNAMES")
val enabledThroughProp = System.getProperty("scalactic.fillFilePathnames")

(enabledThroughEnv != null && enabledThroughEnv == "yes") ||
(enabledThroughProp != null && enabledThroughProp == "yes")
}

private class PositionMacroImpl(val universe: scala.reflect.api.Universe) {
Expand Down

0 comments on commit 37f9fa8

Please sign in to comment.