Skip to content

Commit e0795e0

Browse files
Format sources with spotless
1 parent fe9c498 commit e0795e0

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,18 @@
148148
<url>https://repo.jenkins-ci.org/public/</url>
149149
</pluginRepository>
150150
</pluginRepositories>
151+
152+
<build>
153+
<plugins>
154+
<plugin>
155+
<groupId>com.diffplug.spotless</groupId>
156+
<artifactId>spotless-maven-plugin</artifactId>
157+
<configuration>
158+
<java>
159+
<toggleOffOn />
160+
</java>
161+
</configuration>
162+
</plugin>
163+
</plugins>
164+
</build>
151165
</project>

src/main/java/com/jenkinsci/plugins/badge/action/AbstractBadgeAction.java

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -290,25 +290,32 @@ public static String getJenkinsColorStyle(@NonNull String color) {
290290
} else if (color.startsWith("dark-") && color.length() > 5) {
291291
primary = color.substring(5);
292292
}
293+
// spotless:off
293294
// https://github.com/jenkinsci/jenkins/blob/master/src/main/scss/abstracts/_theme.scss
294295
return switch (primary) {
295-
// palette
296296
case "blue",
297-
"brown",
298-
"cyan",
299-
"green",
300-
"indigo",
301-
"orange",
302-
"pink",
303-
"purple",
304-
"red",
305-
"yellow",
306-
"white",
307-
"black" -> "var(--" + color + ")";
308-
// semantics
309-
case "accent", "text", "error", "warning", "success", "destructive", "build", "danger", "info" -> "var(--"
310-
+ color + "-color)";
297+
"brown",
298+
"cyan",
299+
"green",
300+
"indigo",
301+
"orange",
302+
"pink",
303+
"purple",
304+
"red",
305+
"yellow",
306+
"white",
307+
"black" -> "var(--" + color + ")"; // palette
308+
case "accent",
309+
"text",
310+
"error",
311+
"warning",
312+
"success",
313+
"destructive",
314+
"build",
315+
"danger",
316+
"info" -> "var(--" + color + "-color)"; // semantics
311317
default -> color;
312318
};
319+
// spotless:on
313320
}
314321
}

0 commit comments

Comments
 (0)