Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c567a88

Browse filesBrowse files
authored
Merge pull request hub4j#1005 from bitwiseman/task/spotless
Switch to using spotless plugin for formatting
2 parents b3ff4ac + 6a39d7f commit c567a88
Copy full SHA for c567a88
Expand file treeCollapse file tree

28 files changed

+77
-76
lines changed

‎pom.xml

Copy file name to clipboardExpand all lines: pom.xml
+23-29Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
<hamcrest.version>2.2</hamcrest.version>
4040
<okhttp3.version>4.4.1</okhttp3.version>
4141
<okio.version>2.5.0</okio.version>
42-
<formatter-maven-plugin.goal>format</formatter-maven-plugin.goal>
43-
<impsort-maven-plugin.goal>sort</impsort-maven-plugin.goal>
42+
<spotless-maven-plugin.goal>apply</spotless-maven-plugin.goal>
4443
<!-- Using this as the minimum bar for code coverage. Adding methods without covering them will fail this. -->
4544
<jacoco.coverage.target.bundle.method>0.60</jacoco.coverage.target.bundle.method>
4645
<jacoco.coverage.target.class.method>0.25</jacoco.coverage.target.class.method>
@@ -343,37 +342,34 @@
343342
</executions>
344343
</plugin>
345344
<plugin>
346-
<groupId>net.revelc.code.formatter</groupId>
347-
<artifactId>formatter-maven-plugin</artifactId>
348-
<version>2.12.1</version>
345+
<groupId>com.diffplug.spotless</groupId>
346+
<artifactId>spotless-maven-plugin</artifactId>
347+
<version>2.6.1</version>
349348
<executions>
350349
<execution>
350+
<id>spotless-check</id>
351+
<phase>process-sources</phase>
351352
<goals>
352-
<goal>${formatter-maven-plugin.goal}</goal>
353+
<goal>${spotless-maven-plugin.goal}</goal>
353354
</goals>
354-
<configuration>
355-
<configFile>src/main/resources/eclipse/formatter.xml</configFile>
356-
<cachedir>${project.build.directory}/.cache</cachedir>
357-
</configuration>
358355
</execution>
359356
</executions>
360-
</plugin>
361-
<plugin>
362-
<groupId>net.revelc.code</groupId>
363-
<artifactId>impsort-maven-plugin</artifactId>
364-
<version>1.4.1</version>
365357
<configuration>
366-
<groups>*,java.,javax.</groups>
367-
<removeUnused>true</removeUnused>
368-
<staticAfter>true</staticAfter>
358+
<java>
359+
<eclipse>
360+
<file>${basedir}/src/build/eclipse/formatter.xml</file>
361+
</eclipse>
362+
363+
<importOrder>
364+
<file>${basedir}/src/build/eclipse/eclipse.importorder</file>
365+
</importOrder>
366+
<removeUnusedImports />
367+
368+
<trimTrailingWhitespace />
369+
<endWithNewline />
370+
371+
</java>
369372
</configuration>
370-
<executions>
371-
<execution>
372-
<goals>
373-
<goal>${impsort-maven-plugin.goal}</goal>
374-
</goals>
375-
</execution>
376-
</executions>
377373
</plugin>
378374
<plugin>
379375
<groupId>com.github.spotbugs</groupId>
@@ -595,8 +591,7 @@
595591
</os>
596592
</activation>
597593
<properties>
598-
<formatter-maven-plugin.goal>validate</formatter-maven-plugin.goal>
599-
<impsort-maven-plugin.goal>check</impsort-maven-plugin.goal>
594+
<spotless-maven-plugin.goal>check</spotless-maven-plugin.goal>
600595
</properties>
601596
</profile>
602597
<profile>
@@ -621,8 +616,7 @@
621616
<profile>
622617
<id>release</id>
623618
<properties>
624-
<formatter-maven-plugin.goal>validate</formatter-maven-plugin.goal>
625-
<impsort-maven-plugin.goal>check</impsort-maven-plugin.goal>
619+
<spotless-maven-plugin.goal>check</spotless-maven-plugin.goal>
626620
</properties>
627621
<build>
628622
<plugins>

‎src/build/eclipse/eclipse.importorder

Copy file name to clipboard
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Organize Import Order
2+
# Import this file in Window -> Preferences -> Java -> Code Style -> Organize Imports -> Import...
3+
0=
4+
1=java
5+
2=javax
6+
3=\#

‎src/main/java/org/kohsuke/github/AbstractBuilder.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/AbstractBuilder.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
* <p>
1313
* Batching looks like this:
1414
* </p>
15-
*
15+
*
1616
* <pre>
1717
* update().someName(value).otherName(value).done()
1818
* </pre>
1919
* <p>
2020
* Single changes look like this:
2121
* </p>
22-
*
22+
*
2323
* <pre>
2424
* set().someName(value);
2525
* set().otherName(value);

‎src/main/java/org/kohsuke/github/GHCheckRun.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHCheckRun.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public static enum AnnotationLevel {
295295

296296
/**
297297
* Updates this check run.
298-
*
298+
*
299299
* @return a builder which you should customize, then call {@link GHCheckRunBuilder#create}
300300
*/
301301
@Preview(Previews.ANTIOPE)

‎src/main/java/org/kohsuke/github/GHCommit.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHCommit.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ public PagedIterable<GHCheckRun> getCheckRuns() throws IOException {
574574

575575
/**
576576
* Some of the fields are not always filled in when this object is retrieved as a part of another API call.
577-
*
577+
*
578578
* @throws IOException
579579
* on error
580580
*/

‎src/main/java/org/kohsuke/github/GHContent.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHContent.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public String getPath() {
102102

103103
/**
104104
* Gets target of a symlink. This will only be set if {@code "symlink".equals(getType())}
105-
*
105+
*
106106
* @return the target
107107
*/
108108
public String getTarget() {

‎src/main/java/org/kohsuke/github/GHDeployment.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHDeployment.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public Map<String, Object> getPayloadMap() {
8585

8686
/**
8787
* Gets payload without assuming its type. It could be a String or a Map.
88-
*
88+
*
8989
* @return the payload
9090
*/
9191
public Object getPayloadObject() {

‎src/main/java/org/kohsuke/github/GHEventPayload.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHEventPayload.java
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ public static class Status extends GHEventPayload {
12201220

12211221
/**
12221222
* Gets the status content.
1223-
*
1223+
*
12241224
* @return status content
12251225
*/
12261226
public String getContext() {
@@ -1238,7 +1238,7 @@ public String getTargetUrl() {
12381238

12391239
/**
12401240
* Gets the status description.
1241-
*
1241+
*
12421242
* @return status description
12431243
*/
12441244
public String getDescription() {
@@ -1247,7 +1247,7 @@ public String getDescription() {
12471247

12481248
/**
12491249
* Gets the status state.
1250-
*
1250+
*
12511251
* @return status state
12521252
*/
12531253
public GHCommitState getState() {
@@ -1256,7 +1256,7 @@ public GHCommitState getState() {
12561256

12571257
/**
12581258
* Sets the status stage.
1259-
*
1259+
*
12601260
* @param state
12611261
* status state
12621262
*/
@@ -1266,7 +1266,7 @@ public void setState(GHCommitState state) {
12661266

12671267
/**
12681268
* Gets the commit associated with the status event.
1269-
*
1269+
*
12701270
* @return commit
12711271
*/
12721272
public GHCommit getCommit() {
@@ -1275,7 +1275,7 @@ public GHCommit getCommit() {
12751275

12761276
/**
12771277
* Sets the commit associated with the status event.
1278-
*
1278+
*
12791279
* @param commit
12801280
* commit
12811281
*/

‎src/main/java/org/kohsuke/github/GHGist.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHGist.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public String getGitPushUrl() {
123123

124124
/**
125125
* Get the html url.
126-
*
126+
*
127127
* @return the github html url
128128
*/
129129
public URL getHtmlUrl() {

‎src/main/java/org/kohsuke/github/GHIssueState.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHIssueState.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
*/
3232
public enum GHIssueState {
3333
OPEN, CLOSED, ALL
34-
}
34+
}

‎src/main/java/org/kohsuke/github/GHLabel.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHLabel.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public Updater update() {
187187

188188
/**
189189
* Begins a single property update.
190-
*
190+
*
191191
* @return a {@link Setter}
192192
*/
193193
@BetaApi

‎src/main/java/org/kohsuke/github/GHMilestoneState.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHMilestoneState.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
*/
88
public enum GHMilestoneState {
99
OPEN, CLOSED
10-
}
10+
}

‎src/main/java/org/kohsuke/github/GHObject.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHObject.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public abstract class GHObject {
3838

3939
/**
4040
* Called by Jackson
41-
*
41+
*
4242
* @param responseInfo
4343
* the {@link GitHubResponse.ResponseInfo} to get headers from.
4444
*/

‎src/main/java/org/kohsuke/github/GHOrganization.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHOrganization.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public GHTeam getTeamByName(String name) throws IOException {
181181

182182
/**
183183
* Finds a team that has the given slug in its {@link GHTeam#getSlug()}
184-
*
184+
*
185185
* @param slug
186186
* the slug
187187
* @return the team by slug

‎src/main/java/org/kohsuke/github/GHPermission.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHPermission.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
/**
3030
* Permission for a user in a repository.
31-
*
31+
*
3232
* @see <a href="https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level">API</a>
3333
*/
3434
class GHPermission {

‎src/main/java/org/kohsuke/github/GHPerson.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHPerson.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public String getLocation() throws IOException {
236236

237237
/**
238238
* Gets the Twitter Username of this user, like "GitHub"
239-
*
239+
*
240240
* @return the Twitter username
241241
* @throws IOException
242242
* the io exception

‎src/main/java/org/kohsuke/github/GHProject.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHProject.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,4 +311,4 @@ public GHProjectColumn createColumn(String name) throws IOException {
311311
.fetch(GHProjectColumn.class)
312312
.wrap(this);
313313
}
314-
}
314+
}

‎src/main/java/org/kohsuke/github/GHRateLimit.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRateLimit.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public int hashCode() {
266266
/**
267267
* Merge a {@link GHRateLimit} with another one to create a new {@link GHRateLimit} keeping the latest
268268
* {@link Record}s from each.
269-
*
269+
*
270270
* @param newLimit
271271
* {@link GHRateLimit} with potentially updated {@link Record}s.
272272
* @return a merged {@link GHRateLimit} with the latest {@link Record}s from these two instances. If the merged
@@ -458,7 +458,7 @@ public Record(@JsonProperty(value = "limit", required = true) int limit,
458458
* {@link Record}s with earlier {@link #getResetEpochSeconds()} are replaced by those with later.
459459
* {@link Record}s with the same {@link #getResetEpochSeconds()} are replaced by those with less remaining
460460
* count.
461-
*
461+
*
462462
* {@link UnknownLimitRecord}s compare with each other like regular {@link Record}s.
463463
*
464464
* {@link Record}s are replaced by {@link UnknownLimitRecord}s only when the current {@link Record} is expired

‎src/main/java/org/kohsuke/github/GHRequestedAction.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRequestedAction.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ public URL getHtmlUrl() {
4646
return null;
4747
}
4848

49-
}
49+
}

‎src/main/java/org/kohsuke/github/GitHub.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GitHub.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ public Map<String, Set<GHTeam>> getMyTeams() throws IOException {
741741
* @return the team
742742
* @throws IOException
743743
* the io exception
744-
*
744+
*
745745
* @deprecated Use {@link GHOrganization#getTeam(long)}
746746
* @see <a href= "https://developer.github.com/v3/teams/#get-team-legacy">deprecation notice</a>
747747
*/

‎src/main/java/org/kohsuke/github/PagedIterable.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/PagedIterable.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public Set<T> asSet() {
164164

165165
/**
166166
* Concatenates a list of arrays into a single array.
167-
*
167+
*
168168
* @param type
169169
* the type of array to be returned.
170170
* @param pages

‎src/main/java/org/kohsuke/github/PagedIterator.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/PagedIterator.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ public class PagedIterator<T> implements Iterator<T> {
3535
* Current batch of items. Each time {@link #next()} is called the next item in this array will be returned. After
3636
* the last item of the array is returned, when {@link #next()} is called again, a new page of items will be fetched
3737
* and iterating will continue from the first item in the new page.
38-
*
38+
*
3939
* @see #fetch() {@link #fetch()} for details on how this field is used.
4040
*/
4141
private T[] currentPage;
4242

4343
/**
4444
* The index of the next item on the page, the item that will be returned when {@link #next()} is called.
45-
*
45+
*
4646
* @see #fetch() {@link #fetch()} for details on how this field is used.
4747
*/
4848
private int nextItemIndex;

‎src/main/java/org/kohsuke/github/RateLimitChecker.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/RateLimitChecker.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public abstract class RateLimitChecker {
4444
* {@code true} at least once for a particular request, {@link GitHubRateLimitChecker} may choose to sleep for some
4545
* small additional between calls and before letting the request continue.
4646
* </p>
47-
*
47+
*
4848
* @param rateLimitRecord
4949
* the current {@link GHRateLimit.Record} to check against.
5050
* @param count

‎src/main/java/org/kohsuke/github/RateLimitTarget.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/RateLimitTarget.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Specifies the rate limit record of an operation.
5-
*
5+
*
66
* @see GitHubBuilder#withRateLimitChecker(RateLimitChecker, RateLimitTarget)
77
*/
88
public enum RateLimitTarget {

‎src/main/java/org/kohsuke/github/extras/OkHttpConnector.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/extras/OkHttpConnector.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public OkHttpConnector(OkUrlFactory urlFactory) {
4949

5050
/**
5151
* package private for tests to be able to change max-age for cache.
52-
*
52+
*
5353
* @param urlFactory
5454
* @param cacheMaxAge
5555
*/

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.