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

Bump scalafmt-dynamic_2.13 from 2.7.5 to 3.2.1 #176

Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 3 additions & 19 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,7 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn clean test scoverage:check -Dversion.scala.major=2.12 -Dversion.scala.minor=.10
test_2_11:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn clean package --file pom.xml -Dversion.scala.major=2.11 -Dversion.scala.minor=.12
run: mvn clean test scoverage:check -Dversion.scala.major=2.12 -Dversion.scala.minor=.12
test_2_12:
runs-on: ubuntu-latest
steps:
Expand All @@ -54,7 +38,7 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn clean package --file pom.xml -Dversion.scala.major=2.12 -Dversion.scala.minor=.10
run: mvn clean package --file pom.xml -Dversion.scala.major=2.12 -Dversion.scala.minor=.12
test_2_13:
runs-on: ubuntu-latest
steps:
Expand All @@ -70,4 +54,4 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn clean package --file pom.xml -Dversion.scala.major=2.13 -Dversion.scala.minor=.5
run: mvn clean package --file pom.xml -Dversion.scala.major=2.13 -Dversion.scala.minor=.7
61 changes: 0 additions & 61 deletions .github/workflows/release_211.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/release_212.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ jobs:
gpg_passphrase: ${{ secrets.gpg_passphrase }}
nexus_username: ${{ secrets.nexus_username }}
nexus_password: ${{ secrets.nexus_password }}
maven_args: -Dversion.scala.major=2.12 -Dversion.scala.minor=.10 -Drevision=$(git show -s --format=%ct.%h)
maven_args: -Dversion.scala.major=2.12 -Dversion.scala.minor=.12 -Drevision=$(git show -s --format=%ct.%h)
- name: tag repo
uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
name: 'Ciaran Kearney'
email: '[email protected]'
actor: 'SimonJPegg'
token: '${{ secrets.GITHUB_TOKEN }}'
- run: bash create_release.sh 2.12 .10 SimonJPegg/mvn_scalafmt "$GITHUB_TOKEN"
- run: bash create_release.sh 2.12 .12 SimonJPegg/mvn_scalafmt "$GITHUB_TOKEN"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/release_213.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ jobs:
gpg_passphrase: ${{ secrets.gpg_passphrase }}
nexus_username: ${{ secrets.nexus_username }}
nexus_password: ${{ secrets.nexus_password }}
maven_args: -Dversion.scala.major=2.13 -Dversion.scala.minor=.6 -Drevision=$(git show -s --format=%ct.%h)
maven_args: -Dversion.scala.major=2.13 -Dversion.scala.minor=.7 -Drevision=$(git show -s --format=%ct.%h)
- name: tag repo
uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
name: 'Ciaran Kearney'
email: '[email protected]'
actor: 'SimonJPegg'
token: '${{ secrets.GITHUB_TOKEN }}'
- run: bash create_release.sh 2.13 .1 SimonJPegg/mvn_scalafmt "$GITHUB_TOKEN"
- run: bash create_release.sh 2.13 .7 SimonJPegg/mvn_scalafmt "$GITHUB_TOKEN"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ The latest release should be visible at the top of this readme.
<configLocation>${project.basedir}/.scalafmt.conf</configLocation> <!-- path to config -->
<skipTestSources>false</skipTestSources> <!-- (Optional) skip formatting test sources -->
<skipSources>false</skipSources> <!-- (Optional) skip formatting main sources -->
<respectVersion>false</respectVersion> <!-- (Optional) fail if no version set in scalafmt.conf -->
<sourceDirectories> <!-- (Optional) Paths to source-directories. Overrides ${project.build.sourceDirectory} -->
<param>${project.basedir}/src/main/scala</param>
</sourceDirectories>
Expand Down
6 changes: 4 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.antipathy</groupId>
<artifactId>mvn-scalafmt_${version.scala.major}</artifactId>
<packaging>maven-plugin</packaging>
<version>1.0.${revision}</version>
<version>1.1.${revision}</version>
<name>ScalaFmt Maven Plugin (${version.scala.major})</name>
<description>Maven plugin for ScalaFmt</description>
<url>https://github.com/SimonJPegg/mvn_scalafmt</url>
Expand Down Expand Up @@ -46,7 +46,7 @@
<version.scala.major>2.13</version.scala.major>
<version.scala.minor>.7</version.scala.minor>
<version.scala.xml>1.3.0</version.scala.xml>
<version.scalafmt.dynamic>2.7.5</version.scalafmt.dynamic>
<version.scalafmt.dynamic>3.2.1</version.scalafmt.dynamic>
<version.scalatest>3.3.0-SNAP3</version.scalatest>

<version.maven.plugin.clean>3.1.0</version.maven.plugin.clean>
Expand Down Expand Up @@ -90,6 +90,7 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${version.maven}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
Expand Down Expand Up @@ -130,6 +131,7 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>2.2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.scala-lang.modules</groupId>
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/antipathy/mvn_scalafmt/FormatMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public class FormatMojo extends AbstractMojo {
private List<File> sourceDirectories;
@Parameter(defaultValue = "${project.build.testSourceDirectory}/../scala", required = true)
private List<File> testSourceDirectories;
@Parameter(property = "format.respectVersion", defaultValue = "false", required = true)
private boolean respectVersion;
@Parameter(property = "format.validateOnly", defaultValue = "false")
private boolean validateOnly;
@Parameter(property = "format.onlyChangedFiles", defaultValue = "false")
Expand Down Expand Up @@ -81,7 +79,6 @@ public void execute() throws MojoExecutionException {
Summary result = ScalaFormatter.apply(
configLocation,
getLog(),
respectVersion,
validateOnly,
onlyChangedFiles,
showReformattedOnly,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ object ScalaFormatter {
/** Create a new ScalaFormatter instance
* @param configLocation The location of the scalafmt.conf
* @param log The maven logger
* @param respectVersion should we respect the version in the scalafmt.conf
* @param testOnly should files be reformatted
* @param onlyChangedFiles Should only changed files be formatted
* @param showReformattedOnly print only unformatted files in loggers
Expand All @@ -52,7 +51,6 @@ object ScalaFormatter {
def apply(
configLocation: String,
log: Log,
respectVersion: Boolean,
testOnly: Boolean,
onlyChangedFiles: Boolean,
showReformattedOnly: Boolean,
Expand All @@ -67,7 +65,6 @@ object ScalaFormatter {
val scalafmt = Scalafmt
.create(this.getClass.getClassLoader)
.withReporter(new MavenLogReporter(log))
.withRespectVersion(respectVersion)
.withMavenRepositories(mavenRepositoryUrls.asScala.toSeq: _*)

val sourceFormatter = new SourceFileFormatter(config, scalafmt, log)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import java.io.File
import org.antipathy.mvn_scalafmt.model.FormatResult
import org.apache.commons.io.FileUtils
import org.apache.maven.plugin.logging.Log
import org.antipathy.mvn_scalafmt.ScalaFormatter

/** Class for writing formatted source files
*/
Expand All @@ -17,7 +18,6 @@ class FormattedFilesWriter(log: Log, val showReformattedOnly: Boolean) extends F
* @param input The input to write
*/
protected def processUnformattedFile(input: FormatResult): Unit = {
import org.antipathy.mvn_scalafmt.ScalaFormatter
log.debug(s"Writing ${input.sourceFile.getName} to ${input.sourceFile.getCanonicalPath}")

val newFilePath = input.sourceFile.getCanonicalPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MavenLogReporter(log: Log) extends ScalafmtReporter {

/** This method appears to be used to print download information, sys.err should be fine here.
*/
@Deprecated override def downloadWriter(): PrintWriter = new PrintWriter(System.err)
@deprecated override def downloadWriter(): PrintWriter = new PrintWriter(System.err)

/** This method appears to be used to print download information, sys.err should be fine here.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SourceFileFormatterSpec extends AnyFlatSpec with GivenWhenThen with Matche
val sourceFile = new File("src/main/scala/org/antipathy/mvn_scalafmt/model/FormatResult.scala")
val reporter = new MavenLogReporter(log)
val scalafmt: Scalafmt =
Scalafmt.create(this.getClass.getClassLoader).withRespectVersion(false).withReporter(reporter)
Scalafmt.create(this.getClass.getClassLoader).withReporter(reporter)

val result = new SourceFileFormatter(config, scalafmt, log).format(sourceFile).formattedSource

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import org.apache.maven.plugin.logging.Log
import org.mockito.Mockito
import org.antipathy.mvn_scalafmt.model.FormatResult
import java.io.File

import org.antipathy.mvn_scalafmt.model.{FileSummary, Summary}
import org.antipathy.mvn_scalafmt.model.{FileSummary, Summary, FormatResult}

class TestResultLogWriterSpec extends AnyFlatSpec with GivenWhenThen with Matchers {

Expand Down