From c3c3b97b964bbbde7f577be79fb6bb1a6b0f7d50 Mon Sep 17 00:00:00 2001 From: Matthew Rothenberg Date: Mon, 2 Dec 2019 15:49:36 -0500 Subject: [PATCH 1/2] bump scalafmt-native to v2.2.2 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 81126e7..ec61449 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # This is essentially just scalafmt-native loaded into an alpine container, so # that we have a shell present to expand wildcards etc. -FROM mrothy/scalafmt-native:2.0.1 as scalafmt-native +FROM mrothy/scalafmt-native:2.2.2 as scalafmt-native FROM alpine:latest LABEL "repository"="https://github.com/openlawteam/scalafmt-ci" From 7b5ebf2fb060970e13a3f96fbb16600b0dbf7333 Mon Sep 17 00:00:00 2001 From: Matthew Rothenberg Date: Mon, 2 Dec 2019 20:31:53 -0500 Subject: [PATCH 2/2] pin testdata generation to scalafmt version --- .github/testdata/Good.scala | 1 - Makefile | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/testdata/Good.scala b/.github/testdata/Good.scala index cb00f8d..264d1ae 100644 --- a/.github/testdata/Good.scala +++ b/.github/testdata/Good.scala @@ -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 diff --git a/Makefile b/Makefile index 99c58f2..4bc3353 100644 --- a/Makefile +++ b/Makefile @@ -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 \ < $< > $@