sbt/sbt-scalariform

Name: sbt-scalariform

Owner: sbt

Description: sbt plugin adding support for source code formatting using Scalariform

Created: 2012-10-04 07:19:54.0

Updated: 2017-12-28 01:38:07.0

Pushed: 2017-10-28 14:45:48.0

Homepage: null

Size: 132

Language: Scala

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

sbt-scalariform

Welcome to sbt-scalariform, an sbt plugin adding support for source code formatting using Scalariform.

Installing
btPlugin("org.scalariform" % "sbt-scalariform" % "1.8.2")
Configuration (build.sbt)

Imports

rt scalariform.formatter.preferences._

Example Preferences:

ariformPreferences := scalariformPreferences.value
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(DoubleIndentConstructorArguments, true)
.setPreference(DanglingCloseParenthesis, Preserve)

Sources are automatically formatted on compile and test:compile by default.

To enable Scalariform for integration tests in addition to compile and test:compile add to the build:

ariformItSettings

Other useful configuration options are provided by sbt setting keys:

Configuration (filesystem)

Copy default Scalariform preferences and create a preferences file globally in ~/.scalariform.conf, or locally in projectRoot/.scalariform.conf.

Modify preferences accordingly.

Note: It is not recommended to mix build and filesystem level preferences. If for some reason this is required, to override, for example, global filesystem preferences, create an empty .scalariform.conf file in the project root and define build level preferences accordingly.

Disable Autoformatting / Enable Formatting of Base Directory Sources

Custom configuration options can be applied in the build, or in a .scalariform.conf preferences file.

Build

ariformAutoformat := false
ariformWithBaseDirectory := true

Filesystem

add to the top of target .scalariform.conf file:

format=false
BaseDirectory=true
License

This code is open source software licensed under the Apache 2.0 License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.