Skip to content

feat: Expose useParenthesesForGroovy configuration for Groovy DSL syntax.#1648

Merged
autonomousapps merged 1 commit intoautonomousapps:mainfrom
Freeezzzi:feat/expose-use-parentheses-for-groovy
Apr 2, 2026
Merged

feat: Expose useParenthesesForGroovy configuration for Groovy DSL syntax.#1648
autonomousapps merged 1 commit intoautonomousapps:mainfrom
Freeezzzi:feat/expose-use-parentheses-for-groovy

Conversation

@Freeezzzi
Copy link
Copy Markdown

Problem

In #1522 useParenthesesForGroovy param was added to AdvicePrinter to support parentheses syntax in Groovy build scripts.
From 1522 PR description:

// Space syntax (default)
implementation projects.myModule   
api projects.common.viewmodels  

// Parentheses syntax (when useParenthesesForGroovy = true)
implementation(projects.myModule) 
api(projects.common.viewmodels) 

The parameter existed in the code but it was never exposed as a configurable option - it always defaulted to false.
For proof, here's a search in repository: https://github.com/search?q=repo%3Aautonomousapps%2Fdependency-analysis-gradle-plugin%20useParenthesesForGroovy&type=code

This meant that even if a project consistently used parentheses syntax in Groovy build scripts:

dependencies {
  implementation(libs.core)
  api(projects.myModule)
}

The plugin's advice output (projectHealth, buildHealth) and build script rewriting (fixDependencies) would always produce space:

implementation libs.core
api projects.myModule

How I propose to configure

useParenthesesForGroovy flag is now configurable via the structure {} DSL block.

Configure in settings.gradle[.kts] or root build.gradle[.kts]:

dependencyAnalysis {
  structure {
    useParenthesesForGroovy(true)
  }
}

Copy link
Copy Markdown
Owner

@autonomousapps autonomousapps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@autonomousapps autonomousapps merged commit 91426fb into autonomousapps:main Apr 2, 2026
1 check passed
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 this pull request may close these issues.

2 participants