Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mdr committed Apr 23, 2012
1 parent 30a4324 commit bcea26e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
14 changes: 7 additions & 7 deletions project/Build.scala
Expand Up @@ -8,8 +8,8 @@ object ScalariformBuild extends Build {
lazy val buildSettings = Defaults.defaultSettings ++ Seq( lazy val buildSettings = Defaults.defaultSettings ++ Seq(
organization := "scalariform", organization := "scalariform",
version := "0.1.2-SNAPSHOT", version := "0.1.2-SNAPSHOT",
scalaVersion := "2.9.1", scalaVersion := "2.9.2",
crossScalaVersions := Seq("2.8.0", "2.8.1", "2.8.2", "2.8.3-SNAPSHOT", "2.9.0", "2.9.0-1", "2.9.1", "2.10.0-SNAPSHOT"), crossScalaVersions := Seq("2.8.0", "2.8.1", "2.8.2", "2.9.0", "2.9.0-1", "2.9.1", "2.9.2", "2.10.0-SNAPSHOT"),
resolvers += ScalaToolsSnapshots, resolvers += ScalaToolsSnapshots,
retrieveManaged := true, retrieveManaged := true,
scalacOptions += "-deprecation", scalacOptions += "-deprecation",
Expand All @@ -34,11 +34,11 @@ object ScalariformBuild extends Build {
libraryDependencies <<= (scalaVersion, libraryDependencies) { (sv, deps) => libraryDependencies <<= (scalaVersion, libraryDependencies) { (sv, deps) =>
val scalatestVersion = sv match { val scalatestVersion = sv match {
case "2.8.0" => "org.scalatest" %% "scalatest" % "1.3.1.RC2" % "test" case "2.8.0" => "org.scalatest" %% "scalatest" % "1.3.1.RC2" % "test"
case "2.8.1" => "org.scalatest" %% "scalatest" % "1.5.1" % "test"
case "2.8.2" => "org.scalatest" %% "scalatest" % "1.5.1" % "test" // case "2.8.1" => "org.scalatest" %% "scalatest" % "1.5.1" % "test"
case "2.8.3-SNAPSHOT" => "org.scalatest" % "scalatest_2.8.2" % "1.5.1" % "test" // case "2.8.2" => "org.scalatest" %% "scalatest" % "1.5.1" % "test"
case "2.10.0-SNAPSHOT" => "org.scalatest" % "scalatest_2.9.1" % "1.6.1" % "test" case "2.10.0-SNAPSHOT" => "org.scalatest" % "scalatest_2.9.1" % "1.7.2" % "test"
case _ => "org.scalatest" %% "scalatest" % "1.6.1" % "test" case _ => "org.scalatest" %% "scalatest" % "1.7.2" % "test"
} }
deps :+ scalatestVersion deps :+ scalatestVersion
}, },
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
@@ -1 +1 @@
sbt.version=0.11.0 sbt.version=0.11.2
6 changes: 6 additions & 0 deletions scalariform/.project
Expand Up @@ -20,10 +20,16 @@
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>org.scalastyle.scalastyleplugin.core.ScalastyleBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.scala-ide.sdt.core.scalanature</nature> <nature>org.scala-ide.sdt.core.scalanature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature> <nature>org.eclipse.pde.PluginNature</nature>
<nature>org.scalastyle.scalastyleplugin.core.ScalastyleNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>
Expand Up @@ -11,7 +11,7 @@ object RedundantSemicolonDetector extends App {
* @return all semicolons in the source that could safely be removed without changing the meaning * @return all semicolons in the source that could safely be removed without changing the meaning
* of the program. * of the program.
*/ */
def findRedundantSemis(source: String) = { def findRedundantSemis(source: String): List[Token] = {


def isRedundant(semi: Token, index: Int): Boolean = { def isRedundant(semi: Token, index: Int): Boolean = {
val sourceWithoutSemi = deleteRange(source, semi.range) val sourceWithoutSemi = deleteRange(source, semi.range)
Expand All @@ -37,9 +37,9 @@ object RedundantSemicolonDetector extends App {
object Demo extends App { object Demo extends App {


val source = """ val source = """
class A { class A {
def foo = 42; def foo = 42;
def bar = 123; def baz = 1234 def bar = 123; def baz = 1234
};""" };"""
val redundantSemis = RedundantSemicolonDetector.findRedundantSemis(source) val redundantSemis = RedundantSemicolonDetector.findRedundantSemis(source)
val annotated = redundantSemis.reverse.foldLeft(source) { (s, semi) replaceRange(s, semi.range, "<;>") } val annotated = redundantSemis.reverse.foldLeft(source) { (s, semi) replaceRange(s, semi.range, "<;>") }
Expand Down

0 comments on commit bcea26e

Please sign in to comment.