Skip to content

Commit

Permalink
pin testdata generation to scalafmt version
Browse files Browse the repository at this point in the history
  • Loading branch information
mroth committed Dec 3, 2019
1 parent c3c3b97 commit 7b5ebf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/testdata/Good.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ messiness added to it. -mroth */
package org.scalafmt

sealed abstract class Formatted {

def toEither: Either[Throwable, String] = this match {
case Formatted.Success(s) => Right(s)
case Formatted.Failure(e) => Left(e) // too much space before comment
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@ image:
test:
docker run --rm -it \
-w=$(WORKDIR) \
-v "$$(pwd)/.github/testdata":$(WORKDIR) \
-v "$$(pwd)/$(TESTDATA)":$(WORKDIR) \
$(IMAGE) --list --exclude Bad.scala

# expected failure, to see output
testfail:
docker run --rm -it \
-w=$(WORKDIR) \
-v "$$(pwd)/.github/testdata":$(WORKDIR) \
-v "$$(pwd)/$(TESTDATA)":$(WORKDIR) \
$(IMAGE) --list

# generate the "good" version of the sample file
$(TESTDATA)/Good.scala: $(TESTDATA)/Bad.scala $(TESTDATA)/.scalafmt.conf
docker run --rm -i \
mrothy/scalafmt-native \
--config $(TESTDATA)/.scalafmt.conf \
-v "$$(pwd)/$(TESTDATA)":/conf \
mrothy/scalafmt-native:2.2.2 \
--config /conf/.scalafmt.conf \
--stdin --stdout \
< $< > $@

Expand Down

0 comments on commit 7b5ebf2

Please sign in to comment.