ktlint-gradle icon indicating copy to clipboard operation
ktlint-gradle copied to clipboard

Set verification group on ktlint tasks

Open ZacSweers opened this issue 5 years ago • 7 comments

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 avatar Apr 11 '20 17:04 ZacSweers

Any thoughts?

ZacSweers avatar Apr 21 '20 15:04 ZacSweers

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.

Tapchicoma avatar Apr 23 '20 15:04 Tapchicoma

Could we put them in a ktlint group then?

ZacSweers avatar Apr 23 '20 15:04 ZacSweers

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?

Tapchicoma avatar Apr 23 '20 15:04 Tapchicoma

What's the use case here again? Sorry.

JLLeitschuh avatar Jun 15 '20 20:06 JLLeitschuh

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

ZacSweers avatar Jul 25 '20 18:07 ZacSweers

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?

JLLeitschuh avatar Dec 21 '20 17:12 JLLeitschuh