Spotless issue 373: Cannot add a configuration with name 'classpath' as a configuration with that name already exists

Disclaimer: I haven’t taken much time to understand the codebase.

It seems there’s a race condition initializing the root project’s buildscript classpath. What’s the reason for wanting to create the detached configurations in the root project’s buildscript? Why not create them in the current project?

If you did

Configuration config = project.getConfigurations().detachedConfiguration(deps)

Instead of

Configuration config = project.getRootProject().getBuildscript().getConfigurations().detachedConfiguration(deps)

I’d assume any race conditions could be avoided since each thread would be mutating a separate project instance