Skip to content
This repository has been archived by the owner on Jun 16, 2019. It is now read-only.

Commit

Permalink
Added Spotless for code formatting checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Aidan Follestad authored and Aidan Follestad committed Jun 9, 2017
1 parent fc83da0 commit f450bc5
Show file tree
Hide file tree
Showing 32 changed files with 273 additions and 272 deletions.
3 changes: 3 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 29 additions & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions .idea/modules/ason.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions .idea/modules/ason_main.iml

This file was deleted.

20 changes: 0 additions & 20 deletions .idea/modules/ason_test.iml

This file was deleted.

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ buildscript {
}
dependencies {
classpath 'com.novoda:bintray-release:+'
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.4.0"
}
}

Expand Down Expand Up @@ -43,4 +44,16 @@ jacocoTestReport {
xml.enabled true
html.enabled false
}
}

apply plugin: "com.diffplug.gradle.spotless"

spotless {
java {
target "**/*.java"
trimTrailingWhitespace()
removeUnusedImports()
googleJavaFormat()
endWithNewline()
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
11 changes: 11 additions & 0 deletions local.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Fri Jun 09 14:59:40 CDT 2017
sdk.dir=/Users/z002jdw/Library/Android/sdk
4 changes: 1 addition & 3 deletions src/main/java/com/afollestad/ason/AsonArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
import org.json.JSONException;
import org.json.JSONObject;

/**
* @author Aidan Follestad (afollestad)
*/
/** @author Aidan Follestad (afollestad) */
@SuppressWarnings({"unchecked", "WeakerAccess", "unused", "SameParameterValue"})
public class AsonArray<T> implements Iterable<T> {

Expand Down
8 changes: 2 additions & 6 deletions src/main/java/com/afollestad/ason/AsonIgnore.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
* @author Aidan Follestad (afollestad)
*/
/** @author Aidan Follestad (afollestad) */
@Retention(RUNTIME)
@Target({FIELD})
public @interface AsonIgnore {

}
public @interface AsonIgnore {}
4 changes: 1 addition & 3 deletions src/main/java/com/afollestad/ason/AsonName.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
* @author Aidan Follestad (afollestad)
*/
/** @author Aidan Follestad (afollestad) */
@Retention(RUNTIME)
@Target({FIELD})
public @interface AsonName {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/afollestad/ason/AsonSerializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
import org.json.JSONArray;
import org.json.JSONObject;

/**
* @author Aidan Follestad (afollestad)
*/
/** @author Aidan Follestad (afollestad) */
@SuppressWarnings({"unchecked", "WeakerAccess", "unused"})
class AsonSerializer {

Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/afollestad/ason/ClassCacheEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
import java.util.List;
import java.util.Set;

/**
* @author Aidan Follestad (afollestad)
*/
/** @author Aidan Follestad (afollestad) */
class ClassCacheEntry<T> {

private final Class<T> cls;
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/afollestad/ason/InvalidJsonException.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.afollestad.ason;

/**
* @author Aidan Follestad (afollestad)
*/
/** @author Aidan Follestad (afollestad) */
public class InvalidJsonException extends IllegalArgumentException {

InvalidJsonException(String json, Exception inner) {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/afollestad/ason/InvalidPathException.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.afollestad.ason;

/**
* @author Aidan Follestad (afollestad)
*/
/** @author Aidan Follestad (afollestad) */
public class InvalidPathException extends IllegalArgumentException {

InvalidPathException(String message) {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/afollestad/ason/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
import org.json.JSONArray;
import org.json.JSONObject;

/**
* @author Aidan Follestad (afollestad)
*/
/** @author Aidan Follestad (afollestad) */
class Util {

Util() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/afollestad/ason/AsonArrayTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public void test_array_in_array() {
@Test
public void test_array_in_array_deserialize() {
AsonArray<Integer[]> parent =
new AsonArray<Integer[]>().add(new Integer[]{1, 2, 3, 4}, new Integer[]{5, 6, 7, 8});
new AsonArray<Integer[]>().add(new Integer[] {1, 2, 3, 4}, new Integer[] {5, 6, 7, 8});
assertEquals(2, parent.size());

Integer[] arrayOne = parent.get(0, Integer[].class);
Expand Down
Loading

0 comments on commit f450bc5

Please sign in to comment.