Skip to content

Commit 94409d9

Browse files
scalafmt
1 parent fe48078 commit 94409d9

35 files changed

+855
-652
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ target/
1313
/bin/
1414
/.cache-main
1515
/.cache-tests
16+
admin/.coursier
17+
admin/.scalafmt*

.scalafmt.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
align = more
2+
docstrings = JavaDoc
3+
assumeStandardLibraryStripMargin = true
4+
project.git = true
5+
maxColumn = 100
6+
project.excludeFilters = [
7+
"scalafix/input/"
8+
"scalafix/output/"
9+
"scalafix/output212/"
10+
"scalafix/output212\\+/"
11+
"scalafix/output213/"
12+
"scalafix/output213-failure/"
13+
]
14+
15+

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ matrix:
5959
scala: 2.12.6
6060
env: TEST_BINARY_COMPAT=true
6161

62+
# run scalafmt
63+
- jdk: oraclejdk8
64+
scala: 2.12.6
65+
env: TEST_SCALAFMT=true
66+
6267
# | jdk | scala | scala target | scala target version | scalafix test |
6368
# | ----------- | --------- | ------------ | -------------------- |---------------|
6469
# | openjdk6 | 2.11.12 | jvm | | |

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ class ToIteratorVsIteratorSrc(xs: Iterable[Int]) {
5353
- run sbt
5454
and then run the following task `compile`;
5555

56-
5. Commit your changes, push your branch to your fork and create a pull request.
56+
5. Format your code with the `scalafmt` sbt task.
57+
58+
6. Commit your changes, push your branch to your fork and create a pull request.
5759

5860
Then maybe someone will take over and implement your use case… or maybe you will
5961
(see next section)!

admin/scalafmt.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
# set -x
4+
5+
HERE="`dirname $0`"
6+
VERSION="1.5.1"
7+
COURSIER="$HERE/.coursier"
8+
SCALAFMT="$HERE/.scalafmt-$VERSION"
9+
10+
if [ ! -f $COURSIER ]; then
11+
curl -L -o $COURSIER https://git.io/vgvpD
12+
chmod +x $COURSIER
13+
fi
14+
15+
if [ ! -f $SCALAFMT ]; then
16+
$COURSIER bootstrap com.geirsson:scalafmt-cli_2.11:$VERSION --main org.scalafmt.cli.Cli -o $SCALAFMT
17+
chmod +x $SCALAFMT
18+
fi
19+
20+
$SCALAFMT "$@"

binary-compat/test/src/test/scala/BinaryCompaTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class BinaryCompaTest {
99
@Test
1010
def compat(): Unit = {
1111
Config.setup("foo", Array(oldClasspath, newClasspath))
12-
val mima = new MiMaLib(Config.baseClassPath)
12+
val mima = new MiMaLib(Config.baseClassPath)
1313
val allProblems = mima.collectProblems(oldClasspath, newClasspath)
1414
Assert.assertEquals(allProblems, Nil)
1515
}

0 commit comments

Comments
 (0)