Skip to content

Commit

Permalink
Update to check style 8.4 and ban org.mockito.ArgumentMatcher imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjudd committed Nov 27, 2017
1 parent 4bc86c7 commit fa4100f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ subprojects { project ->
apply plugin: 'checkstyle'

checkstyle {
toolVersion = '6.12.1'
toolVersion = '8.4'
}

checkstyle {
Expand Down
11 changes: 10 additions & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,16 @@
<!-- Prevent importing Mockito matchers directly -->
<module name="IllegalImport">
<property name="illegalPkgs" value="org.mockito.internal" />
<message key="import.illegal" value="Import from illegal package - {0}. Use org.mockito.Matchers to instantiate argument matchers; or org.hamcrest.Matchers for assertThat." />
<message key="import.illegal" value="Import from illegal package - {0}. Use org.mockito.Matchers to instantiate argument matchers." />
</module>

<!-- ArgumentMatchers isn't available internally, the same methods are available on org.mockito.Mockito. -->
<module name="IllegalImport">
<property name="illegalClasses" value="org\.mockito\.ArgumentMatchers\..*" />
<property name="regexp" value="true" />
<message key="import.illegal" value="Import from illegal class - {0}. Use org.mockito.Mockito to statically import matcher methods." />
</module>

<module name="ImportOrder">
<!-- Checks for out of order import statements. -->

Expand All @@ -105,6 +113,7 @@
<!-- This ensures that static imports go first. -->
<property name="option" value="top"/>
<property name="tokens" value="STATIC_IMPORT, IMPORT"/>
<property name="separated" value="true" />
</module>

<!-- Checks for whitespace. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public RequestBuilder<TranscodeType> thumbnail(
@SuppressWarnings({"CheckResult", "unchecked"})
@CheckResult
public RequestBuilder<TranscodeType> thumbnail(
@Nullable RequestBuilder<TranscodeType> /*@Nullable*/ ... thumbnails) {
@Nullable RequestBuilder<TranscodeType>... thumbnails) {
if (thumbnails == null || thumbnails.length == 0) {
return thumbnail((RequestBuilder<TranscodeType>) null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.bumptech.glide.load.resource.SimpleResource;
import com.caverock.androidsvg.SVG;
import com.caverock.androidsvg.SVGParseException;

import java.io.IOException;
import java.io.InputStream;

Expand Down

0 comments on commit fa4100f

Please sign in to comment.