Giter Club home page Giter Club logo

gradle-scalafmt's Introduction

Scalafmt Gradle plugin

Build Status Download

This plugin will allow you to format your scala code as a part of your build process. In the background, it uses scalafmt library.

You can use scalafmt plugin without any configuration. Then defaults from scalafmt will be used. You can adjust these settings by putting .scalafmt.conf to the root of your project. For the supported format and properties see the scalafmt page

We are using scalafmt-dynamic which allows people to choose their scalafmt version inside scalafmt config. As a default, we're still sticking to the last stable version. E.g. to try out this plugin with non-stable 2.0.0-RC4 release, just put version = "2.0.0-RC4" into your scalafmt config.

Usage

plugins {
	id 'cz.alenkacz.gradle.scalafmt' version '$latestVersion'
}

scalafmt {
    // .scalafmt.conf in the project root is default value, provide only if other location is needed
    // config file has to be relative path from current project or root project in case of multimodule projects
    // example usage: 
    // configFilePath = ".scalafmt.conf"
}

Tasks

Tasks added to your project when applying this plugin:

  • scalafmt - formats your scala and sbt source code (main sourceset only)
  • checkScalafmt - checks whether all files are correctly formatted, if not, the task fails (main sourceset only)
  • testScalafmt - formats your test scala code based on the provided configuration
  • checkTestScalafmt - checks whether your test scala code is correctly formatted
  • scalafmtAll - formats scala code from all source sets
  • checkScalafmtAll - checks formatting of all source sets

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.