Optional <until> element ignores violations since a specific Java version #313
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.
This PR introduces a new feature: Ignoring violations past a specific version.
The new, optional XML attribute
<until>holds a version since when a<violation>is to be ignored. This is straight-forward and aligned with the existing syntax, as<version>does exactly the same, but inverse: It ignores violations prior to a specific version.As a first proof-of-concept, the
modernizer.xmlnow has separate proposals for the replacement ofnew File(...):Paths.get(...).Path.of(...).Closes #303
Alternatives:
<until>element, but instead from a set of identically named violations, only apply the one with the highest version within the target version. This is complex to implement and less flexible, as it prevents the possibility to intentionally apply two identially named violations at the same time (I don't know why someone would want that, but I could imagine that there are use cases for this, possibly once we eventually add more functionality besides printing the comment).comment. This is less flexible, as it excludes the possibility to exclude violations in general - it only changes the comment. If eventually we come up with additional functionality (like rewriting code), we might like to skip the violation in general.