Skip to content

Commit 3fbb9e3

Browse files
committed
Setup plugins etc
1 parent e7d526e commit 3fbb9e3

File tree

8 files changed

+161
-5
lines changed

8 files changed

+161
-5
lines changed

.scalafmt.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
style = default
2+
maxColumn = 120
3+
4+
align.openParenCallSite = false
5+
align.openParenDefnSite = false

.travis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
language: scala
2+
sudo: false
3+
4+
scala:
5+
- 2.11.11
6+
- 2.12.3
7+
jdk:
8+
- oraclejdk8
9+
10+
# cache config taken from http://www.scala-sbt.org/0.13/docs/Travis-CI-with-sbt.html
11+
cache:
12+
directories:
13+
- $HOME/.ivy2/cache
14+
- $HOME/.sbt/boot/
15+
16+
before_cache:
17+
- find $HOME/.ivy2 -name "ivydata-*.properties" -delete
18+
- find $HOME/.sbt -name "*.lock" -delete
19+
20+
# build with scoverage report and upload to codecov
21+
script:
22+
- sbt ++$TRAVIS_SCALA_VERSION coverage test coverageReport coverageAggregate
23+
after_success:
24+
- bash <(curl -s https://codecov.io/bash)

build.sbt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import PgpKeys.{publishLocalSigned, publishSigned}
2+
13
organization := "software.purpledragon.xml"
24
version := "0.0.1-SNAPSHOT"
35

@@ -26,8 +28,13 @@ lazy val root = project
2628
)
2729
.settings(
2830
publish := {},
31+
publishSigned := {},
2932
publishLocal := {},
33+
publishLocalSigned := {},
3034
test := {},
3135
testOnly := {}
3236
)
3337
.enablePlugins(ScalaUnidocPlugin)
38+
39+
useGpg := true
40+
usePgpKeyHex("B19D7A14F6F8B3BFA9FF655A5216B5A5F723A92D")

project/SettingsPlugin.scala

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin.autoImport._
2+
import de.heikoseeberger.sbtheader.HeaderPlugin
3+
import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport._
14
import sbt._
25
import sbt.Keys._
36
import sbt.plugins.JvmPlugin
@@ -21,6 +24,16 @@ object SettingsPlugin extends AutoPlugin {
2124
"-feature",
2225
"-unchecked"),
2326
libraryDependencies ++= (libraryDependencies in LocalRootProject).value,
24-
autoAPIMappings := true
27+
scalafmtVersion := "1.2.0",
28+
autoAPIMappings := true,
29+
headerLicense := Some(HeaderLicense.ALv2("2017", "Michael Stringer")),
30+
licenses += ("Apache-2.0", url("https://opensource.org/licenses/Apache-2.0")),
31+
developers := List(
32+
Developer("stringbean", "Michael Stringer", "@the_stringbean", url("https://github.com/stringbean"))
33+
),
34+
organizationName := "Purple Dragon Software",
35+
organizationHomepage := Some(url("https://purpledragon.software")),
36+
homepage := Some(url("https://stringbean.github.io/scala-xml-compare")),
37+
scmInfo := Some(ScmInfo(url("https://github.com/stringbean/scala-xml-compare"), "https://github.com/stringbean/scala-xml-compare.git"))
2538
)
2639
}

project/plugins.sbt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.1")
1+
// code style
2+
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.9.0")
3+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")
4+
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10")
5+
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.1")
6+
7+
// dependency management
8+
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.3.1")
9+
10+
// artifact publishing
11+
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")
12+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
13+
14+
// documentation
15+
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.1")

scalastyle-config.xml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<scalastyle>
2+
<!-- whitespace checks -->
3+
<check class="org.scalastyle.file.FileTabChecker" level="warning"/>
4+
<check class="org.scalastyle.file.WhitespaceEndOfLineChecker" level="warning"/>
5+
<check class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker" level="warning"/>
6+
<check class="org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker" level="warning"/>
7+
<check class="org.scalastyle.scalariform.SpacesAfterPlusChecker" level="warning"/>
8+
<check class="org.scalastyle.scalariform.SpacesBeforePlusChecker" level="warning"/>
9+
10+
<!-- naming checks -->
11+
<check class="org.scalastyle.scalariform.ClassNamesChecker" level="warning"/>
12+
<check class="org.scalastyle.scalariform.MethodNamesChecker" level="warning"/>
13+
<check class="org.scalastyle.scalariform.ObjectNamesChecker" level="warning"/>
14+
<check class="org.scalastyle.scalariform.PackageObjectNamesChecker" level="warning"/>
15+
16+
<!-- size/complexities checks -->
17+
<check class="org.scalastyle.file.FileLengthChecker" level="warning"/>
18+
<check class="org.scalastyle.scalariform.CyclomaticComplexityChecker" level="warning"/>
19+
<check class="org.scalastyle.scalariform.MethodLengthChecker" level="warning"/>
20+
<check class="org.scalastyle.scalariform.NumberOfMethodsInTypeChecker" level="warning"/>
21+
<check class="org.scalastyle.scalariform.NumberOfTypesChecker" level="warning"/>
22+
<check class="org.scalastyle.scalariform.ParameterNumberChecker" level="warning"/>
23+
24+
<check class="org.scalastyle.file.FileLineLengthChecker" level="warning">
25+
<parameters>
26+
<parameter name="maxLineLength">120</parameter>
27+
</parameters>
28+
</check>
29+
30+
<!-- code smells -->
31+
<check class="org.scalastyle.scalariform.CovariantEqualsChecker" level="warning"/>
32+
<check class="org.scalastyle.scalariform.EqualsHashCodeChecker" level="warning"/>
33+
<check class="org.scalastyle.scalariform.IfBraceChecker" level="warning"/>
34+
<check class="org.scalastyle.scalariform.MagicNumberChecker" level="warning"/>
35+
<check class="org.scalastyle.scalariform.NoCloneChecker" level="warning"/>
36+
<check class="org.scalastyle.scalariform.NoFinalizeChecker" level="warning"/>
37+
<check class="org.scalastyle.scalariform.NullChecker" level="warning"/>
38+
<check class="org.scalastyle.scalariform.PublicMethodsHaveTypeChecker" level="warning"/>
39+
<check class="org.scalastyle.scalariform.ReturnChecker" level="warning"/>
40+
<check class="org.scalastyle.scalariform.SimplifyBooleanExpressionChecker" level="warning"/>
41+
<check class="org.scalastyle.scalariform.StructuralTypeChecker" level="warning"/>
42+
<check class="org.scalastyle.scalariform.UppercaseLChecker" level="warning"/>
43+
44+
<check customId="javaconversions" level="error" class="org.scalastyle.scalariform.TokenChecker">
45+
<parameters>
46+
<parameter name="regex">import.*JavaConversions</parameter>
47+
</parameters>
48+
<customMessage>Use JavaConverters instead of JavaConversions</customMessage>
49+
</check>
50+
51+
<check class="org.scalastyle.scalariform.IllegalImportsChecker" level="warning">
52+
<parameters>
53+
<parameter name="illegalImports"><![CDATA[sun._,java.awt._]]></parameter>
54+
</parameters>
55+
</check>
56+
57+
<check class="org.scalastyle.file.RegexChecker" level="warning">
58+
<parameters>
59+
<parameter name="regex"><![CDATA[println]]></parameter>
60+
</parameters>
61+
<customMessage>Remove debug println</customMessage>
62+
</check>
63+
</scalastyle>

xml-scalatest/src/main/scala/software/purpledragon/xml/scalatest/XmlMatchers.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2017 Michael Stringer
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package software.purpledragon.xml.scalatest
218

319
import org.scalatest.matchers.Matcher
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
/*
2+
* Copyright 2017 Michael Stringer
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package software.purpledragon.xml.scalatest
218

319
import org.scalatest.{FlatSpec, Matchers}
420

5-
class XmlMatchersSpec extends FlatSpec with Matchers with XmlMatchers {
6-
7-
}
21+
class XmlMatchersSpec extends FlatSpec with Matchers with XmlMatchers {}

0 commit comments

Comments
 (0)