Comments (7)
We should support this. For now the solution is to do the following:
afterEvaluate {
test.dependsOn ktlintCheck
}
from ktlint-gradle.
@mverleg feel free to reopen if it will not work for you.
from ktlint-gradle.
Thanks for the answer!
I'm afraid it still doesn't work. I can use the task directly, but putting the suggested code in the top-level build.gradle (near the bottom) still gives the same error.
(Using a string ':topproject:ktlintCheck' moves the error to runtime but doesn't work)
from ktlint-gradle.
@mverleg note, that if you have multimodule project, root project will not have test or check tasks. You can archive it with following:
subprojects {
afterEvaluate {
if (it.plugins.findPlugin("org.jlleitschuh.gradle.ktlint") != null) {
check.dependsOn("ktlintCheck")
}
}
}
from ktlint-gradle.
Though I agree in general that check
task should depend on ktlintCheck
task.
from ktlint-gradle.
Actually plugin already set check
task to depend on all ktlint check tasks.
For example:
$ ./gradlew -m :samples:kotlin-ks:check
:samples:kotlin-ks:ktlintMainCheck SKIPPED
:samples:kotlin-ks:ktlintTestCheck SKIPPED
:samples:kotlin-ks:compileKotlin SKIPPED
:samples:kotlin-ks:compileJava SKIPPED
:samples:kotlin-ks:processResources SKIPPED
:samples:kotlin-ks:classes SKIPPED
:samples:kotlin-ks:compileTestKotlin SKIPPED
:samples:kotlin-ks:compileTestJava SKIPPED
:samples:kotlin-ks:processTestResources SKIPPED
:samples:kotlin-ks:testClasses SKIPPED
:samples:kotlin-ks:test SKIPPED
:samples:kotlin-ks:check SKIPPED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 0s
@mverleg can you check it for your project setup?
from ktlint-gradle.
Yeah I made a sample and it does have the dependency by default for JVM project, so I think this will mostly be fixed by #58 .
Though it's worth noting that
test.dependsOn ktlintCheck
still gives the error from the first post, even for JVM. It's not really a problem since it already happens by default, but it's a little weird.
This does work for JVM, but not for other platforms:
afterEvaluate {
test.dependsOn ktlintCheck
}
from ktlint-gradle.
Related Issues (20)
- Disable rule for file pattern HOT 2
- can i know why the additionalEditorconfigFile feature is no longer supported HOT 1
- Support custom SourceSets HOT 1
- Unexpected indentation for super type initialisation HOT 1
- Unexpected indentation (4) (should be 8) HOT 1
- Multiline-expression-wrapping rule breaks ktlintFormat HOT 3
- Function name should start with a lowercase letter for Composable Functions HOT 5
- Override rules for in-line comments and variables starting with underscore HOT 1
- Failing my builds if code isn't formatted HOT 3
- Ktlint Fails to Detect Formatting Issues in Nested Modules HOT 7
- Failing Builds Automatically HOT 1
- Same Issue HOT 6
- Cannot apply to buildSrc HOT 4
- Using this plugin with the official IntelliJ IDE plugin HOT 3
- K2 issue: A failure occurred while executing worker.KtLintWorkAction FILE HOT 2
- Ktlint checks generated source since 12.1.0 HOT 6
- Task KtlintMainSourceSetCheck failed HOT 2
- Task :runKtlintCheckOverMainSourceSet FAILED HOT 3
- import checks HOT 1
- Caches work incorrectly: additionalEditorconfig should be @Input instead of @Internal HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ktlint-gradle.