ktlintFormat and ktlintCheck are not working.
See original GitHub issueI’m trying to apply the plugin to an Android project, but ktlintFormat and ktlinCheck are not working.
For example, let’s take this simple Kotlin file that contains an activity and it’s not well formatted
package com.gianfranco.stormy
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate( savedInstanceState)
setContentView(R.layout.activity_main)
}
}
When I run ./gradlew ktlintCheck or ./gradlew ktlintFormat, nothing happens. The output is BUILD SUCCESSFUL.
The build.gradle for the project can be found here
I’m using Gradle 4.8.1 and AGP 3.2.0-beta03.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
android - Task 'ktlintCheck' not found in project - Stack Overflow
I have installed the pre-commit hook successfully. The 4 below attempts are working the same way even if use app:ktlintCheck. I can run...
Read more >Configuring and running Ktlin on Android Studio
Hello Folks!! The goal of this post is help you to configure and run locally the static code analysis called Ktlint on Android...
Read more >Code Formatting in Kotlin using ktlint - GeeksforGeeks
gradlew ktlintFormat. This will attempt to auto-fix any errors and will report back any issues that could not automatically be fixed.
Read more >lampietti / ktlint-gradle Download - JitPack
This plugin has only been tested with gradle 3.5 and should work with versions ... also adds two meta tasks ktlintCheck and ktlintFormat...
Read more >Ktlint
No configuration required ktlint aims to capture the official Kotlin coding conventions and Android Kotlin Style Guide. · Rule sets ktlint offers a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try also applying the plugin in the
allprojects
block.Why is this? Is this still an issue?