Skip to content

Commit 83f2ac2

Browse files
authored
chore: Force unified imports order (#1793)
1 parent 8f6e2cf commit 83f2ac2

File tree

170 files changed

+649
-692
lines changed

Some content is hidden

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

170 files changed

+649
-692
lines changed

google-style.xml renamed to appium-style.xml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,10 @@
22
<!DOCTYPE module PUBLIC
33
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
44
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
5-
6-
<!-- Originally designed by:-->
75
<!--
8-
Checkstyle configuration that checks the Google coding conventions from Google Java Style
9-
that can be found at https://google.github.io/styleguide/javaguide.html.
10-
11-
Checkstyle is very configurable. Be sure to read the documentation at
12-
http://checkstyle.sf.net (or in your downloaded distribution).
13-
14-
To completely disable a check, just comment it out or delete it from the file.
15-
16-
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
6+
Checkstyle configuration that checks the Appium coding conventions (partially based on Google Java Style
7+
that can be found at https://google.github.io/styleguide/javaguide.html).
178
-->
18-
<!-- Modified by: Sergey Tikhomirov-->
199

2010
<module name = "Checker">
2111
<property name="charset" value="UTF-8"/>
@@ -41,9 +31,16 @@
4131
<property name="allowByTailComment" value="true"/>
4232
<property name="allowNonPrintableEscapes" value="true"/>
4333
</module>
44-
<module name="AvoidStarImport">
45-
<property name="severity" value="warning"/>
46-
</module>
34+
<module name="AvoidStarImport"/>
35+
<module name="CustomImportOrder">
36+
<property name="customImportOrderRules" value="THIRD_PARTY_PACKAGE###SPECIAL_IMPORTS###STANDARD_JAVA_PACKAGE###STATIC"/>
37+
<property name="specialImportsRegExp" value="^javax\."/>
38+
<property name="standardPackageRegExp" value="^java\."/>
39+
<property name="sortImportsInGroupAlphabetically" value="true"/>
40+
<property name="separateLineBetweenGroups" value="false"/>
41+
</module>
42+
<module name="RedundantImport"/>
43+
<module name="UnusedImports"/>
4744
<module name="OneTopLevelClass"/>
4845
<module name="NoLineWrap"/>
4946
<module name="EmptyBlock">

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jacocoTestReport.dependsOn test
9696

9797
checkstyle {
9898
toolVersion = '8.32'
99-
configFile = file("$projectDir/google-style.xml")
99+
configFile = file("$projectDir/appium-style.xml")
100100
showViolations = true
101101
ignoreFailures = false
102102
}

src/main/java/io/appium/java_client/AppiumDriver.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616

1717
package io.appium.java_client;
1818

19-
import static io.appium.java_client.internal.CapabilityHelpers.APPIUM_PREFIX;
20-
import static io.appium.java_client.remote.MobileCapabilityType.AUTOMATION_NAME;
21-
import static io.appium.java_client.remote.MobileCapabilityType.PLATFORM_NAME;
22-
import static org.apache.commons.lang3.StringUtils.isBlank;
23-
2419
import io.appium.java_client.internal.CapabilityHelpers;
2520
import io.appium.java_client.remote.AppiumCommandExecutor;
2621
import io.appium.java_client.remote.AppiumNewSessionCommandPayload;
@@ -51,6 +46,11 @@
5146
import java.util.Collections;
5247
import java.util.Map;
5348

49+
import static io.appium.java_client.internal.CapabilityHelpers.APPIUM_PREFIX;
50+
import static io.appium.java_client.remote.MobileCapabilityType.AUTOMATION_NAME;
51+
import static io.appium.java_client.remote.MobileCapabilityType.PLATFORM_NAME;
52+
import static org.apache.commons.lang3.StringUtils.isBlank;
53+
5454
/**
5555
* Default Appium driver implementation.
5656
*/

src/main/java/io/appium/java_client/AppiumExecutionMethod.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package io.appium.java_client;
1818

1919
import com.google.common.collect.ImmutableMap;
20-
2120
import org.openqa.selenium.remote.ExecuteMethod;
2221
import org.openqa.selenium.remote.Response;
2322

src/main/java/io/appium/java_client/AppiumFluentWait.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package io.appium.java_client;
1818

1919
import com.google.common.base.Throwables;
20-
2120
import lombok.AccessLevel;
2221
import lombok.Getter;
2322
import org.openqa.selenium.TimeoutException;

src/main/java/io/appium/java_client/ComparesImages.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package io.appium.java_client;
1818

19-
import static io.appium.java_client.MobileCommand.compareImagesCommand;
20-
2119
import io.appium.java_client.imagecomparison.ComparisonMode;
2220
import io.appium.java_client.imagecomparison.FeaturesMatchingOptions;
2321
import io.appium.java_client.imagecomparison.FeaturesMatchingResult;
@@ -27,11 +25,13 @@
2725
import io.appium.java_client.imagecomparison.SimilarityMatchingResult;
2826
import org.apache.commons.io.FileUtils;
2927

28+
import javax.annotation.Nullable;
3029
import java.io.File;
3130
import java.io.IOException;
3231
import java.util.Base64;
3332
import java.util.Map;
34-
import javax.annotation.Nullable;
33+
34+
import static io.appium.java_client.MobileCommand.compareImagesCommand;
3535

3636
public interface ComparesImages extends ExecutesMethod {
3737

src/main/java/io/appium/java_client/ErrorCodesMobile.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package io.appium.java_client;
1919

2020
import com.google.common.collect.ImmutableMap;
21-
2221
import org.openqa.selenium.WebDriverException;
2322
import org.openqa.selenium.remote.ErrorCodes;
2423

src/main/java/io/appium/java_client/HasAppStrings.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616

1717
package io.appium.java_client;
1818

19-
import static io.appium.java_client.MobileCommand.GET_STRINGS;
20-
import static io.appium.java_client.MobileCommand.prepareArguments;
21-
2219
import java.util.AbstractMap;
2320
import java.util.Map;
2421

22+
import static io.appium.java_client.MobileCommand.GET_STRINGS;
23+
import static io.appium.java_client.MobileCommand.prepareArguments;
24+
2525
public interface HasAppStrings extends ExecutesMethod {
2626
/**
2727
* Get all defined Strings from an app for the default language.

src/main/java/io/appium/java_client/HasDeviceTime.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@
1616

1717
package io.appium.java_client;
1818

19-
import static io.appium.java_client.MobileCommand.GET_DEVICE_TIME;
20-
2119
import com.google.common.collect.ImmutableList;
2220
import com.google.common.collect.ImmutableMap;
23-
2421
import org.openqa.selenium.remote.DriverCommand;
2522
import org.openqa.selenium.remote.Response;
2623

2724
import java.util.Map;
2825

26+
import static io.appium.java_client.MobileCommand.GET_DEVICE_TIME;
27+
2928
public interface HasDeviceTime extends ExecutesMethod {
3029

3130
/**

src/main/java/io/appium/java_client/HasSettings.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616

1717
package io.appium.java_client;
1818

19-
import static io.appium.java_client.MobileCommand.getSettingsCommand;
20-
import static io.appium.java_client.MobileCommand.setSettingsCommand;
21-
2219
import org.openqa.selenium.remote.Response;
2320

2421
import java.util.EnumMap;
2522
import java.util.Map;
2623
import java.util.Map.Entry;
2724
import java.util.stream.Collectors;
2825

26+
import static io.appium.java_client.MobileCommand.getSettingsCommand;
27+
import static io.appium.java_client.MobileCommand.setSettingsCommand;
28+
2929
public interface HasSettings extends ExecutesMethod {
3030

3131
/**

0 commit comments

Comments
 (0)