Skip to content

Commit db47a65

Browse files
authored
Merge pull request #344 from ckipp01/scalafmt
Add in Scalafmt
2 parents 183fbad + af23965 commit db47a65

File tree

7 files changed

+177
-70
lines changed

7 files changed

+177
-70
lines changed

.github/workflows/ci.yml

+20-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
pull_request:
1010

1111
jobs:
12-
scala:
12+
test:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
@@ -27,5 +27,23 @@ jobs:
2727
distribution: 'adopt'
2828
java-version: ${{ matrix.java }}
2929

30-
- name: run tests
30+
- name: Run tests
3131
run: sbt scripted
32+
33+
formatting:
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- name: checkout the repo
38+
uses: actions/checkout@v2
39+
with:
40+
fetch-depth: 0
41+
42+
- name: Set up JVM
43+
uses: actions/setup-java@v2
44+
with:
45+
distribution: 'adopt'
46+
java-version: '8'
47+
48+
- name: Check Formatting
49+
run: sbt scalafmtCheckAll

.scalafmt.conf

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version = "2.7.5"

build.sbt

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name := "sbt-scoverage"
22

33
import sbt.ScriptedPlugin.autoImport.scriptedLaunchOpts
44

5-
def isCI = System.getenv("CI") != null
65
def scoverageVersion = "1.4.5"
76

87
inThisBuild(
@@ -35,7 +34,7 @@ lazy val root = Project("sbt-scoverage", file("."))
3534
.settings(
3635
libraryDependencies ++= Seq(
3736
"org.scala-lang" % "scala-compiler" % scalaVersion.value % Compile,
38-
"org.scoverage" %% "scalac-scoverage-plugin" % scoverageVersion cross (CrossVersion.full),
37+
"org.scoverage" %% "scalac-scoverage-plugin" % scoverageVersion cross (CrossVersion.full)
3938
),
4039
buildInfoKeys := Seq[BuildInfoKey]("scoverageVersion" -> scoverageVersion),
4140
buildInfoPackage := "scoverage",

project/plugins.sbt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
22
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
33
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
4+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")

src/main/scala/scoverage/ScoverageKeys.scala

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ package scoverage
33
import sbt._
44

55
object ScoverageKeys {
6-
lazy val coverageEnabled = settingKey[Boolean]("controls whether code instrumentation is enabled or not")
6+
// format: off
7+
lazy val coverageEnabled = settingKey[Boolean](
8+
"controls whether code instrumentation is enabled or not"
9+
)
710
lazy val coverageReport = taskKey[Unit]("run report generation")
811
lazy val coverageAggregate = taskKey[Unit]("aggregate reports from subprojects")
912
lazy val coverageExcludedPackages = settingKey[String]("regex for excluded packages")
@@ -17,4 +20,5 @@ object ScoverageKeys {
1720
lazy val coverageOutputDebug = settingKey[Boolean]("turn on the debug report")
1821
lazy val coverageOutputTeamCity = settingKey[Boolean]("turn on teamcity reporting")
1922
lazy val coverageScalacPluginVersion = settingKey[String]("version of scalac-scoverage-plugin to use")
23+
// format: on
2024
}

0 commit comments

Comments
 (0)