[core] Update properties framework#4380
Merged
Merged
Conversation
This was referenced Apr 29, 2023
Closed
adangel
approved these changes
Aug 11, 2023
adangel
left a comment
Member
There was a problem hiding this comment.
Thanks! I finally got around to go through the changes.
I'm planning to work on the TODOs/comments myself in the next couple of days and merge it afterwards.
4 tasks
Update tests and usages for valueFrom/asDelimitedString
- moved deprecated delimiter test to messages - added value as attribute and tag test
Member
Author
|
Thanks for finishing this @adangel ! |
adangel
added a commit
to adangel/pmd
that referenced
this pull request
Aug 31, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the PR
Update the property framework for PMD 7.
delimiterattribute for property definitions is deprecated, produces a warning and its value is ignored.minandmaxattributes for property definitions of numeric properties are no longer required, and can now appear separately, or not at all.Maybe the most arbitrary change is that I removed the ability to configure the delimiter for multi-value properties, and changed the default delimiter to a comma (
,) for all properties. The default delimiter was previously inconsistent as string properties used|for some reason. Many properties were overwriting this with a comma, in an inconsistent and unpredictable manner. There is no change in expressivity as the comma may now be escaped by a backslash. The actual reason I did this is because having a custom delimiter complicates the round-tripping through RulesetWriter a lot. Also I expect that the new syntax for list properties (which is not in this PR) will anyway become a nicer way to write list properties when writing a comma-delimited list is ugly.The API for rules (PropertyFactory) is unchanged except for a couple of new convenience methods, to create enumerated properties from an Enum class.
'
Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)