Giter VIP home page Giter VIP logo

Comments (8)

simschla avatar simschla commented on May 10, 2024 1

as a matter of fact you are totally right both in "when the task is called" and in the statement that spotless is much faster ;-)

from spotless.

nedtwigg avatar nedtwigg commented on May 10, 2024

If you'd like to remove spotlessCheck from the check task, this will do it:

afterEvaluate {
    tasks.getByName('check').dependsOn.remove(tasks.getByName('spotlessCheck'))
}

We're going to keep the default behavior of adding spotlessCheck to check automatically. A positive value in the gradle ecosystem is "convention over configuration" - when you add unit tests, style checkers, static analysis tools, they all hook into check by default, so that you don't have to do the plumbing yourself. Perfectly valid that you'd like to use it a different way though :)

from spotless.

simschla avatar simschla commented on May 10, 2024

Thanks for the workaround, good enough for our case. 👍
Maybe adding this to the Readme.md would help other people too.

from spotless.

nedtwigg avatar nedtwigg commented on May 10, 2024

Maybe adding this to the Readme.md would help other people too.

It's a good question, and GitHub's issue search is very good. Hopefully others who have this same issue will find this question.

I try to make the readme describe the project as concisely as possible. I believe this use case is a less <10% case, and thus doesn't earn a spot. As evidence, if your use case was more common, then every stylechecker / static analyzer / unit test runner in the gradle ecosystem should have this in their readme.

from spotless.

nedtwigg avatar nedtwigg commented on May 10, 2024

Also, out of curiosity, why do you not want spotlessCheck to run on every call to check?

from spotless.

simschla avatar simschla commented on May 10, 2024

We like to separate concerns in the build on CI
e.g. compiling/packaging <-> running unit tests <-> running integration tests <-> auditing code.

Also, we like to keep the build as fast as possible during development to achieve small turnaround times.

from spotless.

nedtwigg avatar nedtwigg commented on May 10, 2024

Here's gradle's task dependency graph:

image

If you'd like to just compile and package, run assemble. If you just want to run tests, run test (or integTest if you've made a separate unit test task).

The objective of the check task is (according to the gradle docs):

All verification tasks in the project, including test. Some plugins add additional verification tasks to the project.

You can use Gradle however you'd like, but it sounds like you're swimming upstream :) If you want people to always be able to run gradle build and have it be fast, I'd recommend that you instead print out the task graph above and leave it on their desk, and then they'll know which tasks to run for themselves, depending on how fast they'd like their result.

Also, spotless is much faster than a reasonable unit test suite :)

from spotless.

kirici avatar kirici commented on May 10, 2024

For anyone else stumbling upon this from Google: this has been added in the meantime.
To remove spotlessCheck as a dependency to check when using the gradle plugin, add

spotless {
    isEnforceCheck = false
}

See the plugin-gradle/README.md

Background

from spotless.

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.