From 7b62455dc7c902e1dc81e5db8792c23245536845 Mon Sep 17 00:00:00 2001 From: twalters Date: Sun, 8 Mar 2026 17:37:12 +0000 Subject: [PATCH] more line length fixes --- SONAR.md | 4 ++++ .../com/solubris/enforcer/VersionPropertyRule.java | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/SONAR.md b/SONAR.md index 9c4329d..d524da4 100644 --- a/SONAR.md +++ b/SONAR.md @@ -4,5 +4,9 @@ Auto scan not triggering With manual scan, scan runs, but no pr decoration +There was a permission request on the solubris github org for sonarcloud, +but it was not accepted so sonarcloud did not have access to the repos. +This is a manual step that needs to be done by someone with admin access to the github org. +Can probably go back to auto scan now. diff --git a/src/main/java/com/solubris/enforcer/VersionPropertyRule.java b/src/main/java/com/solubris/enforcer/VersionPropertyRule.java index cff26bd..3944a67 100644 --- a/src/main/java/com/solubris/enforcer/VersionPropertyRule.java +++ b/src/main/java/com/solubris/enforcer/VersionPropertyRule.java @@ -80,10 +80,10 @@ protected Stream scan() { .filter(Artifact::hasImplicitVersion) .count(); if (artifacts.size() > 1) { - if (propertyCount == 0) return missingPropertyViolation(effectiveVersion, artifacts); - if (propertyCount < artifacts.size()) return unusedPropertyViolation(effectiveVersion, artifacts); + if (propertyCount == 0) return missingProperty(effectiveVersion, artifacts); + if (propertyCount < artifacts.size()) return unusedProperty(effectiveVersion, artifacts); } else if (artifacts.size() == 1) { - if (propertyCount == 1) return redundantPropertyViolation(artifacts.get(0)); + if (propertyCount == 1) return redundantProperty(artifacts.get(0)); } return null; }).filter(Objects::nonNull); @@ -96,7 +96,7 @@ private String fetchVersion(Artifact a, Map> byKey) { return null; } - private String redundantPropertyViolation(Artifact artifact) { + private String redundantProperty(Artifact artifact) { if (allowSingleUseOfProperty) return null; return String.format( @@ -113,7 +113,7 @@ private String redundantPropertyViolation(Artifact artifact) { *

Could the artifacts refer to different properties that have the same value? * That's possible due to coincidental properties - another edge case to consider. */ - private static String unusedPropertyViolation(String effectiveVersion, List artifacts) { + private static String unusedProperty(String effectiveVersion, List artifacts) { String unused = artifacts.stream() .filter(Artifact::hasExplicitVersion) .map(Artifact::key) @@ -128,7 +128,7 @@ private static String unusedPropertyViolation(String effectiveVersion, List artifacts) { + private String missingProperty(String version, List artifacts) { if (!requirePropertiesForDuplicates) return null; String unused = artifacts.stream()