Skip to content

Commit

Permalink
Merge pull request #537 from gabro/line-reporter
Browse files Browse the repository at this point in the history
Append line and column to the default reporter
  • Loading branch information
Duhemm authored Jun 12, 2018
2 parents ab0c88f + 7b42db0 commit bff14ec
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ object DefaultReporterFormat extends (ConfigurableReporter => ReporterFormat) {
class DefaultReporterFormat(reporter: ConfigurableReporter) extends ReporterFormat(reporter) {

protected def formatSourcePath(problem: Problem): Option[String] =
problem.position.pfile.map { f =>
colored(reporter.config.sourcePathColor, f)
problem.position.pfile.map { filePath =>
val line = toOption(problem.position.line).map(":" + _).getOrElse("")
val column = toOption(problem.position.pointer).map(o => s":${o + 1}").getOrElse("")
colored(reporter.config.sourcePathColor, filePath) + s"$line$column"
}

protected def formatSource(problem: Problem): Option[String] =
Expand Down

0 comments on commit bff14ec

Please sign in to comment.