File tree 5 files changed +16
-10
lines changed
scalafmt-core/shared/src/main/scala/org/scalafmt/util
scalafmt-tests/src/test/scala/org/scalafmt/cli
5 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 5
5
-XX:ReservedCodeCacheSize=250M
6
6
-XX:+TieredCompilation
7
7
-XX:-UseGCOverheadLimit
8
- # effectively adds GC to Perm space
9
8
-XX:+CMSClassUnloadingEnabled
10
- # must be enabled for CMSClassUnloadingEnabled to work
11
9
-XX:+UseConcMarkSweepGC
Original file line number Diff line number Diff line change 1
1
version : ' {build}'
2
2
os : Windows Server 2012
3
3
install :
4
- - cmd : choco install sbt -ia "INSTALLDIR=""C:\sbt"""
5
- - cmd : SET PATH=C:\sbt\bin;%JAVA_HOME%\bin;%PATH%
6
- - cmd : SET SBT_OPTS=-XX:MaxPermSize=2g -Xmx4g
4
+ - ps : iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
5
+ - ps : scoop install sbt
7
6
environment :
8
7
CI_SCALA_VERSION : 2.12.2
9
8
build_script :
10
- - sbt update
9
+ - sbt downloadIdea tests/compile
11
10
test_script :
12
- - sbt ci-fast ci-sbt-scalafmt
11
+ - sbt tests/test
13
12
cache :
14
- - C:\sbt\ -> appveyor.yml
15
13
- C:\Users\appveyor\.m2
16
14
- C:\Users\appveyor\.ivy2
17
15
- C:\Users\appveyor\.coursier
16
+ - C:\Users\appveyor\scoop\cache
17
+ - scalafmt-intellij\idea
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ Head over to [the user docs][docs] for instructions on how to install scalafmt.
9
9
10
10
### Quick help
11
11
12
+ - ` sbt compile ` on a clean machine will fail to compile the ` scalafmt-intellij ` project.
13
+ - if you plan to develop the intellij plugin, run ` downloadIdea ` first to fetch the IntelliJ SDK (~ 600mb).
14
+ - or, run ` sbt test ` or ` sbt core/compile ` (specific project).
12
15
- Run all unit tests: ` sbt test `
13
16
- Run only formatting tests: ` tests/testOnly *FormatTests ` .
14
17
- Write new formatting test: read [ this doc] ( scalafmt-tests/src/test/resources/readme.md ) .
Original file line number Diff line number Diff line change @@ -9,4 +9,8 @@ object OsSpecific {
9
9
def fixSeparatorsInPathPattern (unixSpecificPattern : String ): String =
10
10
if (isWindows) unixSpecificPattern.replace(" /" , """ \\ """ )
11
11
else unixSpecificPattern
12
+
13
+ implicit class XtensionStringAsFilename (string : String ) {
14
+ def asFilename : String = fixSeparatorsInPathPattern(string)
15
+ }
12
16
}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import org.scalafmt.config.Config
14
14
import org .scalafmt .config .ScalafmtConfig
15
15
import org .scalafmt .util .AbsoluteFile
16
16
import org .scalafmt .util .DiffAssertions
17
+ import org .scalafmt .util .OsSpecific ._
17
18
import org .scalafmt .util .FileOps
18
19
import org .scalatest .FunSuite
19
20
@@ -233,7 +234,7 @@ class CliTest extends FunSuite with DiffAssertions {
233
234
Array (
234
235
input.path,
235
236
" --exclude" ,
236
- " target/nested"
237
+ " target/nested" .asFilename
237
238
))
238
239
Cli .run(options)
239
240
val obtained = dir2string(input)
@@ -242,7 +243,7 @@ class CliTest extends FunSuite with DiffAssertions {
242
243
243
244
test(" scalafmt doesnotexist.scala throws error" ) {
244
245
def check (filename : String ): Unit = {
245
- val args = Array (s " $filename.scala " )
246
+ val args = Array (s " $filename.scala " .asFilename )
246
247
intercept[FileNotFoundException ] {
247
248
Cli .main(args)
248
249
}
You can’t perform that action at this time.
0 commit comments