Scala FMT Maven Plugin (Not official)

Wrapper for official ScalaFMT formatter to use in Maven

Лицензия

Лицензия

Категории

Категории

Scala Языки программирования
Группа

Группа

com.devsmobile
Идентификатор

Идентификатор

mvn-scalafmt
Последняя версия

Последняя версия

0.2.11
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

Scala FMT Maven Plugin (Not official)
Wrapper for official ScalaFMT formatter to use in Maven
Ссылка на сайт

Ссылка на сайт

https://github.com/pianista215/mvn_scalafmt/
Система контроля версий

Система контроля версий

https://github.com/pianista215/mvn_scalafmt

Скачать mvn-scalafmt

Как подключить последнюю версию

<plugin>
    <groupId>com.devsmobile</groupId>
    <artifactId>mvn-scalafmt</artifactId>
    <version>0.2.11</version>
</plugin>

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-plugin-api jar 3.3.9

provided (1)

Идентификатор библиотеки Тип Версия
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 3.8.1

Модули Проекта

Данный проект не имеет модулей.

Synopsis

This is a wrapper that allows you to use the Scalafmt formatter in Mvn. Current version of the embedded Scalafmt is 0.2.11

Usage

There are two goals by default you can use: verify and format. Verify will launch as default scalafmt with --test -f . through your maven projects. Format will launch as default scalafmt with -i -f . through your maven projects.

To include it into your pom.xml, just specify some lines as below in the phase you want to format/verify your code:

<plugin>
  <groupId>com.devsmobile</groupId>
  <artifactId>mvn-scalafmt</artifactId>
  <version>0.2.11</version>
  <executions>
    <execution>
      <phase>validate</phase>
      <goals>
        <goal>format</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Or

<plugin>
  <groupId>com.devsmobile</groupId>
  <artifactId>mvn-scalafmt</artifactId>
  <version>0.2.11</version>
  <executions>
    <execution>
      <phase>validate</phase>
      <goals>
        <goal>verify</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Additional parameters

If you want to change the default parameters for the format/verify goals, you can provide it in the following properties:

<plugin>
  <groupId>com.devsmobile</groupId>
  <artifactId>mvn-scalafmt</artifactId>
  <version>0.2.11</version>
  <configuration>
    <formatParameters>--maxColumn 110 -i -f .</formatParameters>
    <verifyParameters>--test --maxColumn 110 -f .</verifyParameters>
  </configuration>
  <executions>
    <execution>
      <phase>validate</phase>
      <goals>
        <goal>format</goal>
        <goal>verify</goal>
      </goals>
    </execution>
  </executions>
</plugin>

##Debug If you are finding an strange behaviour with the plugin you can check the exit from scalafmt using -X mvn option which provides Debug log. Also you can remove from your ~/.scalafmt the jar that is copied in order to use the plugin from maven.

##Limitations For now only Linux/Unix is provided. I'm looking to extend it to Windows.

Версии библиотеки

Версия
0.2.11