Added preferences for minor and patch validation

This commit is contained in:
Nieraj Singh
2022-11-17 12:15:36 -08:00
parent 57dc9e8a52
commit 9caadd005a
4 changed files with 46 additions and 6 deletions

View File

@@ -151,7 +151,7 @@ public class VersionValidators {
Generation javaProjectGen, Version javaProjectVersion) throws Exception {
Version latest = VersionValidationUtils.getNewerMinorVersion(springProject, javaProjectVersion);
if (latest != null) {
VersionValidationProblemType problemType = VersionValidationProblemType.UPDATE_LATEST_MAJOR_VERSION;
VersionValidationProblemType problemType = VersionValidationProblemType.UPDATE_LATEST_MINOR_VERSION;
StringBuffer message = new StringBuffer();
message.append("Newer minor version of Spring Boot available: ");
@@ -182,7 +182,7 @@ public class VersionValidators {
Generation javaProjectGen, Version javaProjectVersion) throws Exception {
Version latest = VersionValidationUtils.getNewerPatchVersion(springProject, javaProjectVersion);
if (latest != null) {
VersionValidationProblemType problemType = VersionValidationProblemType.UPDATE_LATEST_MAJOR_VERSION;
VersionValidationProblemType problemType = VersionValidationProblemType.UPDATE_LATEST_PATCH_VERSION;
StringBuffer message = new StringBuffer();
message.append("Newer patch version of Spring Boot available: ");

View File

@@ -28,8 +28,12 @@ public enum VersionValidationProblemType implements ProblemType {
SUPPORTED_COMMERCIAL_VERSION(HINT, "Supported Commercial Version", "Supported Commercial Version"),
UPDATE_LATEST_MAJOR_VERSION(HINT, "Update to Latest Boot Version", "Update to Latest Boot Version");
UPDATE_LATEST_MAJOR_VERSION(HINT, "Update to Latest Major Version", "Update to Latest Major Version"),
UPDATE_LATEST_MINOR_VERSION(HINT, "Update to Latest Minor Version", "Update to Latest Minor Version"),
UPDATE_LATEST_PATCH_VERSION(HINT, "Update to Latest Patch Version", "Update to Latest Patch Version");
private final ProblemSeverity defaultSeverity;
private String description;
private String label;

View File

@@ -329,8 +329,20 @@
},
{
"code": "UPDATE_LATEST_MAJOR_VERSION",
"label": "Update to Latest Boot Version",
"description": "Update to Latest Boot Version",
"label": "Update to Latest Major Version",
"description": "Update to Latest Major Version",
"defaultSeverity": "HINT"
},
{
"code": "UPDATE_LATEST_MINOR_VERSION",
"label": "Update to Latest Minor Version",
"description": "Update to Latest Minor Version",
"defaultSeverity": "HINT"
},
{
"code": "UPDATE_LATEST_PATCH_VERSION",
"label": "Update to Latest Patch Version",
"description": "Update to Latest Patch Version",
"defaultSeverity": "HINT"
}
]

View File

@@ -852,7 +852,31 @@
"spring-boot.ls.problem.version-validation.UPDATE_LATEST_MAJOR_VERSION": {
"type": "string",
"default": "HINT",
"description": "Update to Latest Boot Version",
"description": "Update to Latest Major Version",
"enum": [
"IGNORE",
"INFO",
"WARNING",
"HINT",
"ERROR"
]
},
"spring-boot.ls.problem.version-validation.UPDATE_LATEST_MINOR_VERSION": {
"type": "string",
"default": "HINT",
"description": "Update to Latest Minor Version",
"enum": [
"IGNORE",
"INFO",
"WARNING",
"HINT",
"ERROR"
]
},
"spring-boot.ls.problem.version-validation.UPDATE_LATEST_PATCH_VERSION": {
"type": "string",
"default": "HINT",
"description": "Update to Latest Patch Version",
"enum": [
"IGNORE",
"INFO",