Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same output file for every task #33

Closed
leinardi opened this issue Oct 26, 2017 · 7 comments
Closed

Same output file for every task #33

leinardi opened this issue Oct 26, 2017 · 7 comments

Comments

@leinardi
Copy link

leinardi commented Oct 26, 2017

Currently the output of the all the ktlint*Check task is the same XML file:
image
This means that is not possible to have multiple tasks checking different variants in the same gradle execution (this is really common in CI).

My suggestion is to align the output to the one that Lint is using and generate one file per task:
image

This way is possible to generate multiple reports with a single gradle execution.

I have already fixed this issue locally, if you want I can open a Pull Request.

@originx
Copy link
Contributor

originx commented Oct 26, 2017

should we do it in this PR or a new one?
@leinardi what does the change affect?

#32
@Tapchicoma

@leinardi
Copy link
Author

@originx I think a new one is better. The changes are not in the method touched by #32.
But before creating one I'd like to hear from @Tapchicoma or @JLLeitschuh if they are interested in this.

@JLLeitschuh
Copy link
Owner

I don't personally use the output report.

I'd say that we should make the output configurable on the task but keep the default a sane configuration.

@Tapchicoma
Copy link
Collaborator

It is a good idea, though checkstyle, for example, doesn't do this. It just aggregates everything in one file. Also this is more Android specific, though Gradle start to introduce SoftwareModel that will allow to have flavors on the plain Kotlin projects.

Also this feature should be configurable and disabled by default.

@leinardi
Copy link
Author

leinardi commented Oct 27, 2017

With the current implementation if you run different tasks the output will be always the same file, and this file will be overwritten every time and not merged automatically. So, currently, you loose the report of all the tasks but the last executed.

I don't see what is the benefit of having it disabled by default. It will be useful if you execute different tasks and nothing will change if you only have one beside the name of the file itself.

The file is generate only for the tasks that you are actually executing and not for every variant you have.

In my example I have dozens of variants but I only run two tasks: ktlintNonpayItalyCompatDebugCheck and ktlintNonpayMexicoCompatDebugCheck.

@leinardi
Copy link
Author

OK, I fear I've been misunderstood: I don't want to enable anything new related to the report output, I just want to generate the file name for the output in a different way. To make it more clear I have opened a pull request with my changes. This should have zero impact on non Android builds beside changing the name from reports/ktlint/ktlint.xml to reports/ktlint-reports-main.xml.

@Tapchicoma, @JLLeitschuh please have a look and if you have questions just let me know.

@Tapchicoma
Copy link
Collaborator

Closed via #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants