Comments (10)
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.
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.
@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.
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.
@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.
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.
@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.
@hasnainjaved is this issue still actual?
from ktlint-gradle.
Related commit in KtLint: pinterest/ktlint@30ec67d
from ktlint-gradle.
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)
- 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
- Filter to exclude a generated dir is not working in version 12.1.0 HOT 2
- ktlint pre-commit hook HOT 1
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.