Giter VIP home page Giter VIP logo

Comments (10)

eskatos avatar eskatos commented on May 10, 2024 1

I'd say that in case of a linting failure it would be nice to have the report(s) path(s) in the exception message so that Gradle will display them in the build failure summary. This will make it work nicely even with --parallel and --continue and multiple tasks failure.

Then, logging the report(s) path(s) at e.g. info level should be enough for folks that would like to get the path always, they would simply have to use -i.

from ktlint-gradle.

JLLeitschuh avatar JLLeitschuh commented on May 10, 2024

Umm... Currently no. I don't think we expose that. We could/should. This would probably be easiest to do if we were to make the Ktlint task extend something like SourceTask and then add our own custom fields to it like reportDirectory. That way API consumers could just read from that field.
@Tapchicoma thoughts?

from ktlint-gradle.

Tapchicoma avatar Tapchicoma commented on May 10, 2024

@hasnainjaved can you provide examples of use-case?

Currently plugin always create reports in $project.buildDir/reports/ktlint. Can your CI/CD just grab all the files from that directory?

from ktlint-gradle.

Tapchicoma avatar Tapchicoma commented on May 10, 2024

I don't see the point of adding this feature, but possible solution may be:
check for verbose flag value in extension and on true print "Ktlint report file: ${fileLocation}" to project.logger.warn

from ktlint-gradle.

hasnainjaved avatar hasnainjaved commented on May 10, 2024

@Tapchicoma since CI/CD servers don't have a GUI so grabbing the path from the console and pasting into a browser would be convenient eg. Maven's surefire plugin prints the path of the report in case of test failures. We are currently doing what you have suggested.

@JLLeitschuh Just printing the path would suffice.

from ktlint-gradle.

JLLeitschuh avatar JLLeitschuh commented on May 10, 2024

I don't think we should just print the directory. We should make it something that the user can retrieve as a method or field. Then they can do what they want with it.

from ktlint-gradle.

Tapchicoma avatar Tapchicoma commented on May 10, 2024

@hasnainjaved just to clarify:

You are using some non-Gradle tool to post failed results back to PR as a comment? Not failed builds should not print report path?

Will some Gradle callback suit your goals?

from ktlint-gradle.

Tapchicoma avatar Tapchicoma commented on May 10, 2024

@hasnainjaved is this issue still actual?

from ktlint-gradle.

Tapchicoma avatar Tapchicoma commented on May 10, 2024

Related commit in KtLint: pinterest/ktlint@30ec67d

from ktlint-gradle.

Tapchicoma avatar Tapchicoma commented on May 10, 2024

New released version of KtLint 0.24.0 prints report location in console:

"plain" report written to /home/user/app/build/reports/ktlint/ktlint-release.txt

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.