Skip to content

Commit

Permalink
Setup plugins etc
Browse files Browse the repository at this point in the history
  • Loading branch information
stringbean committed Aug 23, 2017
1 parent e7d526e commit 3fbb9e3
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
style = default
maxColumn = 120

align.openParenCallSite = false
align.openParenDefnSite = false
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: scala
sudo: false

scala:
- 2.11.11
- 2.12.3
jdk:
- oraclejdk8

# cache config taken from http://www.scala-sbt.org/0.13/docs/Travis-CI-with-sbt.html
cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt/boot/

before_cache:
- find $HOME/.ivy2 -name "ivydata-*.properties" -delete
- find $HOME/.sbt -name "*.lock" -delete

# build with scoverage report and upload to codecov
script:
- sbt ++$TRAVIS_SCALA_VERSION coverage test coverageReport coverageAggregate
after_success:
- bash <(curl -s https://codecov.io/bash)
7 changes: 7 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import PgpKeys.{publishLocalSigned, publishSigned}

organization := "software.purpledragon.xml"
version := "0.0.1-SNAPSHOT"

Expand Down Expand Up @@ -26,8 +28,13 @@ lazy val root = project
)
.settings(
publish := {},
publishSigned := {},
publishLocal := {},
publishLocalSigned := {},
test := {},
testOnly := {}
)
.enablePlugins(ScalaUnidocPlugin)

useGpg := true
usePgpKeyHex("B19D7A14F6F8B3BFA9FF655A5216B5A5F723A92D")
15 changes: 14 additions & 1 deletion project/SettingsPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin.autoImport._
import de.heikoseeberger.sbtheader.HeaderPlugin
import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport._
import sbt._
import sbt.Keys._
import sbt.plugins.JvmPlugin
Expand All @@ -21,6 +24,16 @@ object SettingsPlugin extends AutoPlugin {
"-feature",
"-unchecked"),
libraryDependencies ++= (libraryDependencies in LocalRootProject).value,
autoAPIMappings := true
scalafmtVersion := "1.2.0",
autoAPIMappings := true,
headerLicense := Some(HeaderLicense.ALv2("2017", "Michael Stringer")),
licenses += ("Apache-2.0", url("https://opensource.org/licenses/Apache-2.0")),
developers := List(
Developer("stringbean", "Michael Stringer", "@the_stringbean", url("https://github.com/stringbean"))
),
organizationName := "Purple Dragon Software",
organizationHomepage := Some(url("https://purpledragon.software")),
homepage := Some(url("https://stringbean.github.io/scala-xml-compare")),
scmInfo := Some(ScmInfo(url("https://github.com/stringbean/scala-xml-compare"), "https://github.com/stringbean/scala-xml-compare.git"))
)
}
16 changes: 15 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.1")
// code style
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.9.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.1")

// dependency management
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.3.1")

// artifact publishing
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")

// documentation
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.1")
63 changes: 63 additions & 0 deletions scalastyle-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<scalastyle>
<!-- whitespace checks -->
<check class="org.scalastyle.file.FileTabChecker" level="warning"/>
<check class="org.scalastyle.file.WhitespaceEndOfLineChecker" level="warning"/>
<check class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker" level="warning"/>
<check class="org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker" level="warning"/>
<check class="org.scalastyle.scalariform.SpacesAfterPlusChecker" level="warning"/>
<check class="org.scalastyle.scalariform.SpacesBeforePlusChecker" level="warning"/>

<!-- naming checks -->
<check class="org.scalastyle.scalariform.ClassNamesChecker" level="warning"/>
<check class="org.scalastyle.scalariform.MethodNamesChecker" level="warning"/>
<check class="org.scalastyle.scalariform.ObjectNamesChecker" level="warning"/>
<check class="org.scalastyle.scalariform.PackageObjectNamesChecker" level="warning"/>

<!-- size/complexities checks -->
<check class="org.scalastyle.file.FileLengthChecker" level="warning"/>
<check class="org.scalastyle.scalariform.CyclomaticComplexityChecker" level="warning"/>
<check class="org.scalastyle.scalariform.MethodLengthChecker" level="warning"/>
<check class="org.scalastyle.scalariform.NumberOfMethodsInTypeChecker" level="warning"/>
<check class="org.scalastyle.scalariform.NumberOfTypesChecker" level="warning"/>
<check class="org.scalastyle.scalariform.ParameterNumberChecker" level="warning"/>

<check class="org.scalastyle.file.FileLineLengthChecker" level="warning">
<parameters>
<parameter name="maxLineLength">120</parameter>
</parameters>
</check>

<!-- code smells -->
<check class="org.scalastyle.scalariform.CovariantEqualsChecker" level="warning"/>
<check class="org.scalastyle.scalariform.EqualsHashCodeChecker" level="warning"/>
<check class="org.scalastyle.scalariform.IfBraceChecker" level="warning"/>
<check class="org.scalastyle.scalariform.MagicNumberChecker" level="warning"/>
<check class="org.scalastyle.scalariform.NoCloneChecker" level="warning"/>
<check class="org.scalastyle.scalariform.NoFinalizeChecker" level="warning"/>
<check class="org.scalastyle.scalariform.NullChecker" level="warning"/>
<check class="org.scalastyle.scalariform.PublicMethodsHaveTypeChecker" level="warning"/>
<check class="org.scalastyle.scalariform.ReturnChecker" level="warning"/>
<check class="org.scalastyle.scalariform.SimplifyBooleanExpressionChecker" level="warning"/>
<check class="org.scalastyle.scalariform.StructuralTypeChecker" level="warning"/>
<check class="org.scalastyle.scalariform.UppercaseLChecker" level="warning"/>

<check customId="javaconversions" level="error" class="org.scalastyle.scalariform.TokenChecker">
<parameters>
<parameter name="regex">import.*JavaConversions</parameter>
</parameters>
<customMessage>Use JavaConverters instead of JavaConversions</customMessage>
</check>

<check class="org.scalastyle.scalariform.IllegalImportsChecker" level="warning">
<parameters>
<parameter name="illegalImports"><![CDATA[sun._,java.awt._]]></parameter>
</parameters>
</check>

<check class="org.scalastyle.file.RegexChecker" level="warning">
<parameters>
<parameter name="regex"><![CDATA[println]]></parameter>
</parameters>
<customMessage>Remove debug println</customMessage>
</check>
</scalastyle>
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2017 Michael Stringer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package software.purpledragon.xml.scalatest

import org.scalatest.matchers.Matcher
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
/*
* Copyright 2017 Michael Stringer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package software.purpledragon.xml.scalatest

import org.scalatest.{FlatSpec, Matchers}

class XmlMatchersSpec extends FlatSpec with Matchers with XmlMatchers {

}
class XmlMatchersSpec extends FlatSpec with Matchers with XmlMatchers {}

0 comments on commit 3fbb9e3

Please sign in to comment.