Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Scala to 2.13 #1522

Merged
merged 18 commits into from
Oct 17, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Benchmarks moved to 2.12 directory, sbt downgraded
  • Loading branch information
poslegm committed Oct 14, 2019
commit 62fb8db90ed93272edf68c319c2cc682824b2c06
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.3.2
sbt.version=1.2.8
Original file line number Diff line number Diff line change
@@ -1,41 +1,14 @@
package org.scalafmt.benchmarks

import scala.collection.GenIterable
import scala.meta.Source
import scala.meta.testkit.Corpus
import scala.meta.testkit.CorpusFile
import scala.util.Try
package benchmarks

import java.util.concurrent.TimeUnit

import org.openjdk.jmh.annotations.Benchmark
import org.openjdk.jmh.annotations.BenchmarkMode
import org.openjdk.jmh.annotations.Measurement
import org.openjdk.jmh.annotations.Mode
import org.openjdk.jmh.annotations.OutputTimeUnit
import org.openjdk.jmh.annotations.Scope
import org.openjdk.jmh.annotations.Setup
import org.openjdk.jmh.annotations.Warmup
import org.openjdk.jmh.annotations._
import org.scalafmt.Scalafmt
import org.scalafmt.config.RewriteSettings
import org.scalafmt.config.ScalafmtConfig
import org.scalafmt.rewrite.RedundantBraces
import org.scalafmt.rewrite.SortImports
import org.scalafmt.benchmarks.FormatBenchmark

trait FormatBenchmark {
def formatRewrite(code: String) = {
Scalafmt
.format(
code,
style = ScalafmtConfig.default.copy(
rewrite = RewriteSettings(
rules = Seq(SortImports, RedundantBraces)
)
)
)
.get
}
}
import scala.collection.GenIterable
import scala.meta.testkit.Corpus
import scala.util.Try

/**
* Formats filename at with scalafmt.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.scalafmt.benchmarks

import org.scalafmt.Scalafmt
import org.scalafmt.config.{RewriteSettings, ScalafmtConfig}
import org.scalafmt.rewrite.{RedundantBraces, SortImports}

trait FormatBenchmark {
def formatRewrite(code: String): String = {
Scalafmt
.format(
code,
style = ScalafmtConfig.default.copy(
rewrite = RewriteSettings(
rules = Seq(SortImports, RedundantBraces)
)
)
)
.get
}
}
Original file line number Diff line number Diff line change
@@ -3,25 +3,9 @@ package org.scalafmt.benchmarks
import java.io.File
import java.util.concurrent.TimeUnit

import org.openjdk.jmh.annotations.Benchmark
import org.openjdk.jmh.annotations.BenchmarkMode
import org.openjdk.jmh.annotations.Measurement
import org.openjdk.jmh.annotations.Mode
import org.openjdk.jmh.annotations.OutputTimeUnit
import org.openjdk.jmh.annotations.Scope
import org.openjdk.jmh.annotations.Setup
import org.openjdk.jmh.annotations.Warmup
import org.openjdk.jmh.annotations._
import org.scalafmt.Scalafmt
import org.scalafmt.util.FileOps
import scala.meta.Source

import org.scalafmt.config.RedundantBracesSettings
import org.scalafmt.config.RewriteSettings
import org.scalafmt.config.ScalafmtOptimizer
import org.scalafmt.config.ScalafmtRunner
import org.scalafmt.config.ScalafmtConfig
import org.scalafmt.rewrite.RedundantBraces
import org.scalafmt.rewrite.SortImports

/**
* Formats filename at [[path]] with scalafmt.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.scalafmt.benchmarks

import benchmarks.MacroBenchmark
import org.scalafmt.benchmarks.Micro.ScalaJsFile
import org.scalatest.FunSuite