gradle icon indicating copy to clipboard operation
gradle copied to clipboard

Enable stricter validation of plugins by default for validatePlugins task

Open 3flex opened this issue 3 years ago • 6 comments

Gradle should strictly validate plugins written by plugin authors who have applied java-gradle-plugin plugin to their projects.

Expected Behavior

enableStricterValidation is set to true by default for ValidatePlugins tasks.

Current Behavior

Plugin authors have to know that this option exists, and enable it, to get all validations to run on their plugins. This means there are many plugins in the wild that do not get validated by default.

Context

I use Gradle plugins. I like it when they behave :)

3flex avatar Nov 03 '22 06:11 3flex

This feature request is in the backlog of the relevant team but this area of Gradle is currently not a focus one so it might take a while before it gets implemented.

eskatos avatar Nov 16 '22 09:11 eskatos

I'd be happy to create a PR? It seems a simple one to implement.

3flex avatar Nov 16 '22 11:11 3flex

@akshayabd this might be an answer to my question about checking code.

@eskatos I would love to see this merged too, would a PR be accepted? Are there extra considerations other than changing the value and updating the migration guide?

TWiStErRob avatar Jun 01 '23 20:06 TWiStErRob

Another option could be to remove stricter validation as a separate option, and make it the only option. The only difference this would make is that inputs on tasks not marked as @CacheableTask would still be validated for the presence of path normalization.

lptr avatar Aug 11 '23 12:08 lptr

Thanks for the offer of PRs, but the difficulty is not so much in flipping this switch itself, but in how we handle the change. Flipping the switch directly would mean a breaking change for some plugins, and we don't do that in a minor version. I'd much rather use this opportunity to simplify things and remove the stricter validation option altogether, but that is not a simple change anymore.

lptr avatar Aug 11 '23 12:08 lptr

Nag when false in 8.x, change default to true in 9, remove in 10?

3flex avatar Feb 20 '24 00:02 3flex