Gradle: how to run lint automatically with `check`?
See original GitHub issueI don’t know if this is a bug or just my ignorance regarding Gradle, but I can’t seem to do:
test.dependsOn ktlintCheck
I get this message:
A problem occurred evaluating root project 'lintsetup'.
> Could not get unknown property 'ktlintCheck' for root project 'lintsetup' of type org.gradle.api.Project.
I created an otherwise clean project, which has a build.gradle
like this:
buildscript {
ext.kotlin_version = '1.2.21'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "org.jlleitschuh.gradle.ktlint" version "3.0.0"
}
group 'lintsetup'
version '1.0-SNAPSHOT'
apply plugin: 'kotlin-platform-jvm'
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testCompile "junit:junit:4.12"
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
}
test.dependsOn ktlintCheck
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Improve your code with lint checks - Android Developers
Run lint from the command line. Run lint using the standalone tool ; Configure lint to suppress warnings. Configure lint in Android Studio;...
Read more >How Do We Configure Android Studio to Run Its Lint on Every ...
Edit the project configuration · In the General tab of the configuration, scroll down and fold open the "Before launch" panel · In...
Read more >Writing your first Lint check - Medium
The first parameter is the id. That one can be used to suppress it via the @SuppressLint annotation.
Read more >Using static checks for Android development with annotations ...
Lint checks are automatically performed by the Gradle build system. To see the available checks in Android Studio File Settings Editor Inspections.
Read more >Leveraging Android Lint Checks - ProAndroidDev
Available within Android Studio as warnings or run directly via gradle via lintDebug; Lint checks are run directly within Android Studio on ...
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
@mverleg feel free to reopen if it will not work for you.
We should support this. For now the solution is to do the following: