Scalariform Maven plugin

September 27, 2021 ยท View on GitHub

Maven Central

Main

Scalariform Maven plugin

Maven plugin for Scalariform, a Scala code formatter.

Usage

Add a section like below in your POM-file:

<plugins>
  <plugin>
    <groupId>com.github.tashoyan</groupId>
    <artifactId>scalariform-maven-plugin</artifactId>
    <version>0.2.3</version>
    <configuration>
      <firstArgumentOnNewline>Force</firstArgumentOnNewline>
      <firstParameterOnNewline>Force</firstParameterOnNewline>
      <allowParamGroupsOnNewlines>true</allowParamGroupsOnNewlines>
      <danglingCloseParenthesis>Force</danglingCloseParenthesis>
      <doubleIndentConstructorArguments>true</doubleIndentConstructorArguments>
      <doubleIndentMethodDeclaration>true</doubleIndentMethodDeclaration>
      <newlineAtEndOfFile>true</newlineAtEndOfFile>
      <placeScaladocAsterisksBeneathSecondAsterisk>true</placeScaladocAsterisksBeneathSecondAsterisk>
      <singleCasePatternOnNewline>false</singleCasePatternOnNewline>
      <spacesAroundMultiImports>false</spacesAroundMultiImports>
    </configuration>
  </plugin>
  ...
</plugins>

The plugin has just one goal: format, by default it is bound to process-sources lifecycle phase.

Settings

NameDefault valueDescription
sourceDirectorysrc/main/scalaDirectory with Scala sources
testSourceDirectorysrc/test/scalaDirectory with Scala test sources

For Scalariform settings, see Scalariform web page.

License

MIT License

Credits

Forked from Matt Russell's repo and updated to support Scalariform 0.2.x as well as Maven 3 API.

Originally contributed to Scalariform by Adam Crain.