Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Nov 30, 2018
2 parents 566c364 + 88aec0d commit e96aa02
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 18 deletions.
5 changes: 5 additions & 0 deletions qulice-checkstyle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<packaging>jar</packaging>
<name>qulice-checkstyle</name>
<dependencies>
<dependency>
<groupId>org.cactoos</groupId>
<artifactId>cactoos</artifactId>
<version>0.38</version>
</dependency>
<dependency>
<groupId>com.qulice</groupId>
<artifactId>qulice-spi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@
<property name="fileExtensions" value="java"/>
<property name="message" value="Use 'java.nio.charset.StandardCharsets' instead"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="com\.google\.common\.base\.Charsets"/>
<property name="fileExtensions" value="java"/>
<property name="message" value="Use 'java.nio.charset.StandardCharsets' instead"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="^(?! *(/\*\*|\*|/\*|//)).*[\.\-\+%/\*&lt;&gt;] *$"/>
<property name="fileExtensions" value="java"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@
import java.util.Collection;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.cactoos.list.ListOf;
import org.hamcrest.Description;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.hamcrest.TypeSafeMatcher;
import org.hamcrest.collection.IsIterableContainingInOrder;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -221,24 +223,32 @@ public void reportsAllCharEncodingUsages() throws Exception {
final String name = "RegexpSinglelineCheck";
MatcherAssert.assertThat(
results,
Matchers.hasItems(
new ViolationMatcher(
message, file, "6", name
),
new ViolationMatcher(
message, file, "7", name
),
new ViolationMatcher(
message, file, "8", name
),
new ViolationMatcher(
message, file, "20", name
),
new ViolationMatcher(
message, file, "21", name
),
new ViolationMatcher(
message, file, "22", name
new IsIterableContainingInOrder<>(
new ListOf<>(
new ViolationMatcher(
message, file, "6", name
),
new ViolationMatcher(
message, file, "7", name
),
new ViolationMatcher(
message, file, "8", name
),
new ViolationMatcher(
message, file, "9", name
),
new ViolationMatcher(
message, file, "22", name
),
new ViolationMatcher(
message, file, "23", name
),
new ViolationMatcher(
message, file, "24", name
),
new ViolationMatcher(
message, file, "25", name
)
)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
package foo;

import com.google.common.base.Charsets;
import org.apache.commons.codec.CharEncoding;
import org.apache.commons.lang.CharEncoding;
import org.apache.commons.lang3.CharEncoding;
Expand All @@ -17,8 +18,10 @@ public final class DoNotUseCharEncoding {
*/
public void act() {
System.out.println(this + CharEncoding.UTF_8);
System.out.println(this + Charsets.UTF_8);
System.out.println(org.apache.commons.lang3.CharEncoding.UTF_8);
System.out.println(org.apache.commons.lang.CharEncoding.ISO_8859_1);
System.out.println(org.apache.commons.codec.CharEncoding.UTF_16);
System.out.println(com.google.common.base.Charsets.UTF_8);
}
}

0 comments on commit e96aa02

Please sign in to comment.