Skip to content

Commit b195973

Browse files
committed
Spotless apply
1 parent 58ea42e commit b195973

File tree

68 files changed

+1864
-1577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1864
-1577
lines changed

pom.xml

Lines changed: 64 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,89 @@
1111
<artifactId>gitlab-branch-source</artifactId>
1212
<version>${changelist}</version>
1313
<packaging>hpi</packaging>
14-
<properties>
15-
<changelist>999999-SNAPSHOT</changelist>
16-
<jenkins.version>2.361.4</jenkins.version>
17-
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
18-
</properties>
1914
<name>GitLab Branch Source Plugin</name>
2015
<description>GitLab Provides branch source and folder organisation functionality for GitLab Repositories in Jenkins Source Plugin</description>
16+
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
17+
2118
<licenses>
2219
<license>
2320
<name>MIT License</name>
2421
<url>https://opensource.org/licenses/MIT</url>
2522
</license>
2623
</licenses>
24+
25+
<scm>
26+
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
27+
<developerConnection>scm:git:[email protected]:${gitHubRepo}.git</developerConnection>
28+
<tag>${scmTag}</tag>
29+
<url>https://github.com/${gitHubRepo}</url>
30+
</scm>
31+
32+
<properties>
33+
<changelist>999999-SNAPSHOT</changelist>
34+
<jenkins.version>2.361.4</jenkins.version>
35+
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
36+
<spotless.check.skip>false</spotless.check.skip>
37+
</properties>
38+
39+
<dependencyManagement>
40+
<dependencies>
41+
<dependency>
42+
<groupId>io.jenkins.tools.bom</groupId>
43+
<artifactId>bom-2.361.x</artifactId>
44+
<version>2025.v816d28f1e04f</version>
45+
<type>pom</type>
46+
<scope>import</scope>
47+
</dependency>
48+
</dependencies>
49+
</dependencyManagement>
50+
2751
<dependencies>
2852
<dependency>
29-
<groupId>org.jenkins-ci.plugins</groupId>
30-
<artifactId>apache-httpcomponents-client-4-api</artifactId>
53+
<groupId>io.jenkins.plugins</groupId>
54+
<artifactId>gitlab-api</artifactId>
3155
</dependency>
3256
<dependency>
3357
<groupId>org.jenkins-ci.plugins</groupId>
34-
<artifactId>scm-api</artifactId>
58+
<artifactId>apache-httpcomponents-client-4-api</artifactId>
3559
</dependency>
3660
<dependency>
37-
<groupId>io.jenkins.plugins</groupId>
38-
<artifactId>gitlab-api</artifactId>
61+
<groupId>org.jenkins-ci.plugins</groupId>
62+
<artifactId>branch-api</artifactId>
3963
</dependency>
4064
<dependency>
4165
<groupId>org.jenkins-ci.plugins</groupId>
4266
<artifactId>credentials</artifactId>
4367
</dependency>
4468
<dependency>
4569
<groupId>org.jenkins-ci.plugins</groupId>
46-
<artifactId>plain-credentials</artifactId>
70+
<artifactId>git</artifactId>
4771
</dependency>
4872
<dependency>
4973
<groupId>org.jenkins-ci.plugins</groupId>
5074
<artifactId>handy-uri-templates-2-api</artifactId>
5175
</dependency>
5276
<dependency>
5377
<groupId>org.jenkins-ci.plugins</groupId>
54-
<artifactId>git</artifactId>
78+
<artifactId>plain-credentials</artifactId>
79+
</dependency>
80+
<dependency>
81+
<groupId>org.jenkins-ci.plugins</groupId>
82+
<artifactId>scm-api</artifactId>
83+
</dependency>
84+
<dependency>
85+
<groupId>org.jenkins-ci.plugins.workflow</groupId>
86+
<artifactId>workflow-job</artifactId>
87+
</dependency>
88+
<dependency>
89+
<groupId>io.jenkins</groupId>
90+
<artifactId>configuration-as-code</artifactId>
91+
<scope>test</scope>
92+
</dependency>
93+
<dependency>
94+
<groupId>io.jenkins.configuration-as-code</groupId>
95+
<artifactId>test-harness</artifactId>
96+
<scope>test</scope>
5597
</dependency>
5698
<dependency>
5799
<groupId>org.hamcrest</groupId>
@@ -63,6 +105,11 @@
63105
<artifactId>pipeline-build-step</artifactId>
64106
<scope>test</scope>
65107
</dependency>
108+
<dependency>
109+
<groupId>org.jenkins-ci.plugins</groupId>
110+
<artifactId>pipeline-stage-step</artifactId>
111+
<scope>test</scope>
112+
</dependency>
66113
<dependency>
67114
<groupId>org.jenkins-ci.plugins.workflow</groupId>
68115
<artifactId>workflow-api</artifactId>
@@ -80,119 +127,35 @@
80127
</dependency>
81128
<dependency>
82129
<groupId>org.jenkins-ci.plugins.workflow</groupId>
83-
<artifactId>workflow-scm-step</artifactId>
130+
<artifactId>workflow-durable-task-step</artifactId>
84131
<scope>test</scope>
85132
</dependency>
86133
<dependency>
87134
<groupId>org.jenkins-ci.plugins.workflow</groupId>
88-
<artifactId>workflow-step-api</artifactId>
135+
<artifactId>workflow-multibranch</artifactId>
89136
<scope>test</scope>
90137
</dependency>
91138
<dependency>
92139
<groupId>org.jenkins-ci.plugins.workflow</groupId>
93-
<artifactId>workflow-support</artifactId>
140+
<artifactId>workflow-scm-step</artifactId>
94141
<scope>test</scope>
95142
</dependency>
96143
<dependency>
97144
<groupId>org.jenkins-ci.plugins.workflow</groupId>
98-
<artifactId>workflow-multibranch</artifactId>
99-
<scope>test</scope>
100-
</dependency>
101-
<dependency>
102-
<groupId>org.jenkins-ci.plugins</groupId>
103-
<artifactId>pipeline-stage-step</artifactId>
145+
<artifactId>workflow-step-api</artifactId>
104146
<scope>test</scope>
105147
</dependency>
106148
<dependency>
107149
<groupId>org.jenkins-ci.plugins.workflow</groupId>
108-
<artifactId>workflow-durable-task-step</artifactId>
150+
<artifactId>workflow-support</artifactId>
109151
<scope>test</scope>
110152
</dependency>
111153
<dependency>
112154
<groupId>org.mockito</groupId>
113155
<artifactId>mockito-core</artifactId>
114156
<scope>test</scope>
115157
</dependency>
116-
<dependency>
117-
<groupId>io.jenkins</groupId>
118-
<artifactId>configuration-as-code</artifactId>
119-
<scope>test</scope>
120-
</dependency>
121-
<dependency>
122-
<groupId>io.jenkins.configuration-as-code</groupId>
123-
<artifactId>test-harness</artifactId>
124-
<scope>test</scope>
125-
</dependency>
126-
<dependency>
127-
<groupId>org.jenkins-ci.plugins</groupId>
128-
<artifactId>branch-api</artifactId>
129-
</dependency>
130-
<dependency>
131-
<groupId>org.jenkins-ci.plugins.workflow</groupId>
132-
<artifactId>workflow-job</artifactId>
133-
</dependency>
134158
</dependencies>
135-
<dependencyManagement>
136-
<dependencies>
137-
<dependency>
138-
<groupId>io.jenkins.tools.bom</groupId>
139-
<artifactId>bom-2.361.x</artifactId>
140-
<version>2025.v816d28f1e04f</version>
141-
<scope>import</scope>
142-
<type>pom</type>
143-
</dependency>
144-
</dependencies>
145-
</dependencyManagement>
146-
147-
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
148-
149-
<scm>
150-
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
151-
<developerConnection>scm:git:[email protected]:${gitHubRepo}.git</developerConnection>
152-
<url>https://github.com/${gitHubRepo}</url>
153-
<tag>${scmTag}</tag>
154-
</scm>
155-
156-
<build>
157-
<pluginManagement>
158-
<plugins>
159-
<plugin>
160-
<groupId>org.apache.maven.plugins</groupId>
161-
<artifactId>maven-checkstyle-plugin</artifactId>
162-
<version>3.2.0</version>
163-
<dependencies>
164-
<dependency>
165-
<groupId>com.puppycrawl.tools</groupId>
166-
<artifactId>checkstyle</artifactId>
167-
<version>9.3</version>
168-
</dependency>
169-
</dependencies>
170-
</plugin>
171-
</plugins>
172-
</pluginManagement>
173-
<plugins>
174-
<plugin>
175-
<artifactId>maven-checkstyle-plugin</artifactId>
176-
<configuration>
177-
<configLocation>${project.basedir}/.mvn/checkstyle.xml</configLocation>
178-
<includeTestSourceDirectory>true</includeTestSourceDirectory>
179-
<sourceDirectories>
180-
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
181-
</sourceDirectories>
182-
<testSourceDirectories>
183-
<sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
184-
</testSourceDirectories>
185-
</configuration>
186-
<executions>
187-
<execution>
188-
<goals>
189-
<goal>check</goal>
190-
</goals>
191-
</execution>
192-
</executions>
193-
</plugin>
194-
</plugins>
195-
</build>
196159

197160
<repositories>
198161
<repository>

src/main/java/io/jenkins/plugins/gitlabbranchsource/AbstractGitLabSCMHeadEvent.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,4 @@ public boolean isMatch(@NonNull SCM scm) {
7878
protected abstract Map<SCMHead, SCMRevision> headsFor(GitLabSCMSource source);
7979

8080
public abstract GitLabWebHookCause getCause();
81-
8281
}

src/main/java/io/jenkins/plugins/gitlabbranchsource/BranchDiscoveryTrait.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public int getStrategyId() {
6969
@Restricted(NoExternalUse.class)
7070
public boolean isBuildBranch() {
7171
return (strategyId & 1) != 0;
72-
7372
}
7473

7574
/**
@@ -168,15 +167,13 @@ public ListBoxModel doFillStrategyIdItems() {
168167
/**
169168
* Trusts branches from the origin repository.
170169
*/
171-
public static class BranchSCMHeadAuthority extends
172-
SCMHeadAuthority<SCMSourceRequest, BranchSCMHead, SCMRevision> {
170+
public static class BranchSCMHeadAuthority extends SCMHeadAuthority<SCMSourceRequest, BranchSCMHead, SCMRevision> {
173171

174172
/**
175173
* {@inheritDoc}
176174
*/
177175
@Override
178-
protected boolean checkTrusted(@NonNull SCMSourceRequest request,
179-
@NonNull BranchSCMHead head) {
176+
protected boolean checkTrusted(@NonNull SCMSourceRequest request, @NonNull BranchSCMHead head) {
180177
return true;
181178
}
182179

@@ -191,8 +188,7 @@ public static class DescriptorImpl extends SCMHeadAuthorityDescriptor {
191188
* {@inheritDoc}
192189
*/
193190
@Override
194-
public boolean isApplicableToOrigin(
195-
@NonNull Class<? extends SCMHeadOrigin> originClass) {
191+
public boolean isApplicableToOrigin(@NonNull Class<? extends SCMHeadOrigin> originClass) {
196192
return SCMHeadOrigin.Default.class.isAssignableFrom(originClass);
197193
}
198194

@@ -204,8 +200,6 @@ public boolean isApplicableToOrigin(
204200
public String getDisplayName() {
205201
return Messages.BranchDiscoveryTrait_authorityDisplayName();
206202
}
207-
208-
209203
}
210204
}
211205

@@ -223,7 +217,7 @@ public boolean isExcluded(@NonNull SCMSourceRequest request, @NonNull SCMHead he
223217
for (MergeRequest m : ((GitLabSCMSourceRequest) request).getMergeRequests()) {
224218
// only match if the merge request is an origin merge request
225219
if (m.getSourceProjectId().equals(m.getTargetProjectId())
226-
&& m.getSourceBranch().equalsIgnoreCase(head.getName())) {
220+
&& m.getSourceBranch().equalsIgnoreCase(head.getName())) {
227221
return true;
228222
}
229223
}
@@ -245,7 +239,7 @@ public boolean isExcluded(@NonNull SCMSourceRequest request, @NonNull SCMHead he
245239
if (head instanceof BranchSCMHead && request instanceof GitLabSCMSourceRequest) {
246240
for (MergeRequest m : ((GitLabSCMSourceRequest) request).getMergeRequests()) {
247241
if (m.getSourceProjectId().equals(m.getTargetProjectId())
248-
&& !m.getSourceBranch().equalsIgnoreCase(head.getName())) {
242+
&& !m.getSourceBranch().equalsIgnoreCase(head.getName())) {
249243
return true;
250244
}
251245
}
@@ -254,4 +248,3 @@ public boolean isExcluded(@NonNull SCMSourceRequest request, @NonNull SCMHead he
254248
}
255249
}
256250
}
257-

src/main/java/io/jenkins/plugins/gitlabbranchsource/BranchSCMRevision.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ public BranchSCMRevision(BranchSCMHead head, String hash) {
88
super(head, hash);
99
}
1010
}
11-

src/main/java/io/jenkins/plugins/gitlabbranchsource/BuildStatusNameCustomPartTrait.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public String getBuildStatusNameCustomPart() {
6262
*
6363
* @return build status name overwrite option
6464
*/
65-
public boolean getBuildStatusNameOverwrite() { return buildStatusNameOverwrite; }
65+
public boolean getBuildStatusNameOverwrite() {
66+
return buildStatusNameOverwrite;
67+
}
6668

6769
/**
6870
* Our descriptor.

src/main/java/io/jenkins/plugins/gitlabbranchsource/Cause/GitLabCauseUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ public static int defaultListSize(List<?> anyList) {
1010
return anyList == null ? 0 : anyList.size();
1111
}
1212

13-
public static String defaultLabelString (LabelType labelType) {
13+
public static String defaultLabelString(LabelType labelType) {
1414
return labelType == null ? "" : labelType.toString();
1515
}
1616

17-
public static String defaultBooleanString(Boolean bool) {
17+
public static String defaultBooleanString(Boolean bool) {
1818
return bool == null ? "" : bool.toString();
1919
}
2020

21-
public static String defaultVisibilityString(AccessLevel accessLevel) {
21+
public static String defaultVisibilityString(AccessLevel accessLevel) {
2222
return accessLevel == null ? "" : accessLevel.toString();
2323
}
2424

25-
public static String defaultDateString(Date date) {
25+
public static String defaultDateString(Date date) {
2626
return date == null ? "" : date.toString();
2727
}
2828

29-
public static String defaultIntString(Integer val) {
29+
public static String defaultIntString(Integer val) {
3030
return val == null ? "" : val.toString();
3131
}
3232

33-
public static String defaultLongString(Long val) {
33+
public static String defaultLongString(Long val) {
3434
return val == null ? "" : val.toString();
3535
}
3636
}

0 commit comments

Comments
 (0)