Skip to content

Commit

Permalink
Add root *.scala sources if sourcesInBase is true
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldraper committed Jun 16, 2017
1 parent b08307c commit fa17713
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@ package com.lucidchart.sbt.scalafmt

import com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin.autoImport._
import sbt._
import sbt.Keys._

object ScalafmtPlugin extends AutoPlugin {

override val projectSettings = Seq(Compile, Test).flatMap(inConfig(_)(scalafmtSettings))
override val projectSettings = Seq(Compile, Test).flatMap(inConfig(_)(scalafmtSettings)) ++
inConfig(Compile)(
inTask(scalafmt)(
Seq(
sources ++= {
val finder = (baseDirectory.value * includeFilter.value) --- (baseDirectory.value * excludeFilter.value)
if (sourcesInBase.value) finder.get else Seq.empty
}
)
)
)

override val requires = ScalafmtCorePlugin

Expand Down

0 comments on commit fa17713

Please sign in to comment.