Skip to content

Commit 86e53b3

Browse files
committed
switch from checkstyle to spotless
1 parent 9cec428 commit 86e53b3

Some content is hidden

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

48 files changed

+1382
-1007
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.0'
7+
}
8+
}
9+
110
ext {
211
jsoupVersion = '1.18.3'
312
okhttpVersion = '4.12.0'
@@ -7,20 +16,27 @@ ext {
716
}
817

918
allprojects {
10-
apply plugin: 'java'
11-
apply plugin: 'checkstyle'
19+
group = 'ru.funpay4j'
20+
version = '1.0.6'
21+
}
1222

13-
checkstyle {
14-
configFile = file("$rootProject.projectDir/src/checkstyle/checkstyle.xml")
15-
ignoreFailures = false
16-
}
23+
def javaVersion = JavaVersion.current()
1724

18-
checkstyleMain {
19-
source = 'src/main/java'
20-
}
25+
subprojects { subproject ->
26+
if (subproject.name != 'examples' && javaVersion.compareTo(JavaVersion.VERSION_1_8) == 0) {
27+
apply plugin: 'com.diffplug.spotless'
2128

22-
checkstyleTest {
23-
source = 'src/test/java'
29+
spotless {
30+
java {
31+
target("src/main/java/**/*.java", "src/test/java/**/*.java")
32+
33+
googleJavaFormat().aosp()
34+
importOrder("java", "javax", "org", "com")
35+
removeUnusedImports()
36+
trimTrailingWhitespace()
37+
endWithNewline()
38+
}
39+
}
2440
}
2541

2642
repositories {
@@ -35,6 +51,4 @@ allprojects {
3551
options.encoding = 'UTF-8'
3652
}
3753

38-
group = 'ru.funpay4j'
39-
version = '1.0.6'
4054
}

client/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'java'
2+
id 'java-library'
33
}
44

55
dependencies {

client/src/main/java/ru/funpay4j/client/client/FunPayClient.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
package ru.funpay4j.client.client;
1616

17-
import ru.funpay4j.client.request.SaveOfferRequest;
1817
import ru.funpay4j.client.exceptions.FunPayApiException;
1918
import ru.funpay4j.client.exceptions.InvalidCsrfTokenOrPHPSESSIDException;
2019
import ru.funpay4j.client.exceptions.InvalidGoldenKeyException;
2120
import ru.funpay4j.client.exceptions.offer.OfferAlreadyRaisedException;
21+
import ru.funpay4j.client.request.SaveOfferRequest;
2222

2323
/**
2424
* Interface for sending thematic requests to FunPay
@@ -35,7 +35,8 @@ public interface FunPayClient {
3535
* @throws FunPayApiException if the other api-related exception
3636
* @throws InvalidGoldenKeyException if the golden key is invalid
3737
*/
38-
void updateAvatar(String goldenKey, byte[] newAvatar) throws FunPayApiException, InvalidGoldenKeyException;
38+
void updateAvatar(String goldenKey, byte[] newAvatar)
39+
throws FunPayApiException, InvalidGoldenKeyException;
3940

4041
/**
4142
* Send a request to raise all offers
@@ -47,7 +48,8 @@ public interface FunPayClient {
4748
* @throws InvalidGoldenKeyException if the golden key is invalid
4849
* @throws OfferAlreadyRaisedException if the offer already raised
4950
*/
50-
void raiseAllOffers(String goldenKey, long gameId, long lotId) throws FunPayApiException, InvalidGoldenKeyException, OfferAlreadyRaisedException;
51+
void raiseAllOffers(String goldenKey, long gameId, long lotId)
52+
throws FunPayApiException, InvalidGoldenKeyException, OfferAlreadyRaisedException;
5153

5254
/**
5355
* Send a request to save offer
@@ -60,8 +62,10 @@ public interface FunPayClient {
6062
* @throws InvalidGoldenKeyException if the golden key is invalid
6163
* @throws InvalidCsrfTokenOrPHPSESSIDException if the csrf token or PHPSESSID is invalid
6264
*/
63-
void saveOffer(String goldenKey, String csrfToken, String phpSessionId , SaveOfferRequest request) throws FunPayApiException,
64-
InvalidGoldenKeyException, InvalidCsrfTokenOrPHPSESSIDException;
65+
void saveOffer(
66+
String goldenKey, String csrfToken, String phpSessionId, SaveOfferRequest request)
67+
throws FunPayApiException, InvalidGoldenKeyException,
68+
InvalidCsrfTokenOrPHPSESSIDException;
6569

6670
/**
6771
* Send a request to add offer image
@@ -72,5 +76,6 @@ void saveOffer(String goldenKey, String csrfToken, String phpSessionId , SaveOff
7276
* @throws FunPayApiException if the other api-related exception
7377
* @throws InvalidGoldenKeyException if the golden key is invalid
7478
*/
75-
Long addOfferImage(String goldenKey, byte[] image) throws FunPayApiException, InvalidGoldenKeyException;
76-
}
79+
Long addOfferImage(String goldenKey, byte[] image)
80+
throws FunPayApiException, InvalidGoldenKeyException;
81+
}

0 commit comments

Comments
 (0)