-
Notifications
You must be signed in to change notification settings - Fork 10
Adding recipe to return minimum JUnit version #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- build.gradle.kts
- lines 21-20
- src/main/java/org/openrewrite/java/dependencies/search/FindMinimumDependencyVersion.java
- lines 20-20
src/main/java/org/openrewrite/java/dependencies/search/FindMinimumDependencyVersion.java
Outdated
Show resolved
Hide resolved
…imumDependencyVersion.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
src/main/java/org/openrewrite/java/dependencies/search/FindMinimumDependencyVersion.java
Outdated
Show resolved
Hide resolved
"If both JUnit 4 and JUnit 5 are present, the minimum version is JUnit 4. " + | ||
"If only one version is present, that version is the minimum version.", | ||
example = "4", | ||
valid = {"4", "5"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're 3 months away from 6.0.0-M1: https://github.com/junit-team/junit5/milestone/87
valid = {"4", "5"}, | |
valid = {"4", "5", "6"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As JUnit 6 is not released at this time, we won't know how to determine if they are using JUnit 6. We might want to add this after we know how to determine if JUnit 6 is being used
public String getDescription() { | ||
return "A recipe to find the minimum version of JUnit dependencies. " + | ||
"It will search for JUnit 4 and JUnit 5 dependencies in the project. " + | ||
"If both versions are found, it will return the minimum version of JUnit 4."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should call out here that this recipe is intended as a measure to tell projects that have (some) JUnit 4 apart from projects that have no JUnit 4 (but some JUnit 5). No that's a bit implied in the logic below, but making it explicit might prevent confusion for users, as well as devs that change this in months to come.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I'm going to update the description to include more details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good already, I've pushed some very light polish, but otherwise good to merge if you ask me. I did ask whether we should update the description, but also fine to keep that as is.
What's changed?
Adding a new recipe which returns the minimum JUnit version
What's your motivation?
We need a recipe to return the minimum JUnit version for the DevCenter. Currently, we are finding annotations but this finds all JUnits versions which are used not the minimum version which is used