Giter VIP home page Giter VIP logo

ktlint-gradle's Introduction

Ktlint Gradle

Join the chat at https://gitter.im/ktlint-gradle/Lobby Build Status

Provides a convenient wrapper plugin over the ktlint project.

This plugin can be applied to any project but only activates if that project has the kotlin plugin applied. The assumption being that you would not want to lint code you weren't compiling.

Warning

This uses/publishes with a beta version of gradle. I plan to fix this as soon as the newest version of gradle script kotlin is released with a stable version of kotlin.

How to use

Build script snippet for use in all Gradle versions:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:1.0.1"
  }
}

apply plugin: "org.jlleitschuh.gradle.ktlint"

Build script snippet for new, incubating, plugin mechanism introduced in Gradle 2.1:

plugins {
  id "org.jlleitschuh.gradle.ktlint" version "1.0.1"
}

Configuration

The following configuration block is optional.

If you don't configure this the defaults defined in the KtlintExtension object will be used. The version of Ktlint used by default may change between patch versions of this plugin. If you don't want to inherit these changes then make sure you lock your version here.

ktlint {
    version = ""
    debug = true
    verbose = true
}

Tasks Added

This plugin adds two tasks to every source set: ktlint[source set name] and ktlint[source set name]Format. Additionally, a simple ktlint task has also been added that checks all of the source sets for that project. Similarly, a ktlintFormat task has been added that formats all of the source sets.

Developers

Building

./gradlew build

Future Development

Add support for linting *.kts for gradle script kotlin builds.

Links

Ktlint Gradle Plugin on the Gradle Plugin Registry

ktlint-gradle's People

Contributors

jlleitschuh avatar gitter-badger avatar

Watchers

James Cloos avatar dev.with avatar

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.