/scalariform-maven-plugin

Maven plugin for Scalariform, a Scala code formatter

Primary LanguageJava

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

Name Default value Description
sourceDirectory src/main/scala Directory with Scala sources
testSourceDirectory src/test/scala Directory 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.