JLLeitschuh / ktlint-gradle

A ktlint gradle plugin
MIT License
1.45k stars 159 forks source link

Set verification group on ktlint tasks #350

Open ZacSweers opened 4 years ago

ZacSweers commented 4 years ago

Currently tasks are group-less, which means they go on to a "other" catch-all. Would be nice if these could go in the verification group. Happy to send a PR.

ZacSweers commented 4 years ago

Any thoughts?

Tapchicoma commented 4 years ago

Hm, personally I would not add specific source sets tasks to verification group - they will just pollute it.

Meta tasks (trigger all related source tasks) are in the verification group already. Could you explain me what you try to accomplish?

And maybe @JLLeitschuh has another opinion on it.

ZacSweers commented 4 years ago

Could we put them in a ktlint group then?

Tapchicoma commented 4 years ago

Gradle doesn't support marking a task as "private". However, gradle tasks will only show a task if it either has task.group set, or no other task depends on it.

Actually we probably could set verification group on all tasks :thinking: Source Set tasks should be hidden as meta tasks depend on them. Could you create a PR?

JLLeitschuh commented 4 years ago

What's the use case here again? Sorry.

ZacSweers commented 4 years ago

To group them appropriately rather than all get dumped in "other"

JLLeitschuh commented 3 years ago

From what I've seen, this plugin can end up generating quite a few tasks. Especially when you have the cross compilation Kotlin plugins applied. I'm concerned that a change like this adds little value and will just result in information overload in the output of :tasks.

There's also the argument that many of the tasks that we generate are 'internal' and should only be executed in aggregate. Maybe I'm wrong.

When you add the 'group' it usually indicates to the user that we're fine that you explicitly invoke those specific sub-tasks instead of running the aggregator tasks. I don't know if that's the kind of behaviour we actually want to be encouraging.

Thoughts?