Skip to content

Introduce ruleName for rules configuration - #893

Merged
slawekjaranowski merged 1 commit into
apache:masterfrom
slawekjaranowski:rule-name
Jun 26, 2025
Merged

slawekjaranowski merged 1 commit into
apache:masterfrom
slawekjaranowski:rule-name

Conversation

@slawekjaranowski

Copy link
Copy Markdown
Member

We can define the same rule multiple times with different configuration
Each execution has the same default name, with ruleName we can differentiate them

We can define the same rule multiple times with different configuration
Each execution has the same default name, with ruleName we can differentiate them
@slawekjaranowski slawekjaranowski added the enhancement New feature or request label Jun 22, 2025
@slawekjaranowski slawekjaranowski added this to the 3.6.0 milestone Jun 22, 2025
@slawekjaranowski slawekjaranowski self-assigned this Jun 22, 2025

@cstamas cstamas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+0 Is good, and handy, but this relies on Plexus configuration/field injection.
@gnodet WDYT?

@Bukama Bukama left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+0.5 (see comment, might be done in a separate PR, but should be considerd before first release of this features)

public String getName() {
return name;
String ruleName = rule.getRuleName();
return ruleName == null || ruleName.isEmpty() ? name : ruleName;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Names with only whitespace are allowed as isEmpty() only checks length == 0. isBlank() (JDK 11?) implies trim() I suggest to disallow whitespace rule names.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

content is pom tags are trimed by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants