Comments (4)
Alternative suggestion that I just thought of (I could be swayed either way on this one):
Create a separate plugin (under the same repository (and maybe even under the same source directory)) that is called something like ktlint-helpers
. This helpers plugin is automatically applied when you apply the ktlint
plugin but when you only apply the ktlint-helpers
plugin you only get the tasks that don't modify the check
task.
@Tapchicoma, what are your thoughts?
from ktlint-gradle.
Tough question, you have very specific use-case here.
Regarding option one:
ktlint {
automaticallyAddToCheckTask = false
}
Then also there should be a flag for format tasks.
Regarding option two - conceptually I like it more, then the first one. From implementation wise - not sure how to approach it. Like add that ktlint
plugin depends on ktlint-helpers
plugin?
Can you archive the same goal by using Gradle property switch?
if (project.hasProperty("KtLint")) {
apply plugin: "org.jlleitschuh.gradle.ktlint"
...
}
and then whoever is needed this task can run it using following:
$ ./gradlew -PKtLint ktlintApplyToIdea
from ktlint-gradle.
That last option you proposed seems very "not gradley". I'm going to take a crack at my second plugin option and see how that works.
from ktlint-gradle.
@JLLeitschuh do you want to keep this issue opened after 5.0.0
release?
Otherwise, please, close it.
from ktlint-gradle.
Related Issues (20)
- Same Issue HOT 6
- Cannot apply to buildSrc HOT 4
- Using this plugin with the official IntelliJ IDE plugin HOT 4
- 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
- Filter to exclude a generated dir is not working in version 12.1.0 HOT 3
- ktlint pre-commit hook HOT 1
- Using ktlint-gradle with ktlint-intellij-plugin and baseline file
- Is there way to know which (maximum) ktlint versions are supported? HOT 2
- Version number in documentation
- deprecate old android flag
- unknown ktlint version HOT 2
- hxgc
- Deprecation warning with `ActionUpdateThread` HOT 1
- Upgrade ktlint-cli -> `VULNERALIBILTY` on logback-classic HOT 1
- How to use baseline when the project has multiple modules?
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.