Coder Social home page Coder Social logo

Comments (4)

JLLeitschuh avatar JLLeitschuh commented on September 24, 2024

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.

Tapchicoma avatar Tapchicoma commented on September 24, 2024

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.

JLLeitschuh avatar JLLeitschuh commented on September 24, 2024

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.

Tapchicoma avatar Tapchicoma commented on September 24, 2024

@JLLeitschuh do you want to keep this issue opened after 5.0.0 release?

Otherwise, please, close it.

from ktlint-gradle.

Related Issues (20)

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.