Skip to content

Commit b384513

Browse files
valfirstlkoe
authored andcommitted
Fix #84: upgrade to checkstyle 8.11
1 parent f709efb commit b384513

File tree

9 files changed

+28
-15
lines changed

9 files changed

+28
-15
lines changed

net.sf.eclipsecs.checkstyle/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
99
<classpathentry kind="src" path="metadata/"/>
1010
<classpathentry kind="src" path="test"/>
11-
<classpathentry exported="true" kind="lib" path="checkstyle-8.10.1-all.jar" sourcepath="checkstyle-checkstyle-8.10.1.zip"/>
11+
<classpathentry exported="true" kind="lib" path="checkstyle-8.11-all.jar" sourcepath="checkstyle-checkstyle-8.11.zip"/>
1212
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
1313
<classpathentry kind="output" path="target/classes"/>
1414
</classpath>

net.sf.eclipsecs.checkstyle/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ Export-Package: .,
4646
com.puppycrawl.tools.checkstyle.utils,
4747
org.apache.commons.beanutils;version="8.10.1"
4848
Bundle-ClassPath: .,
49-
checkstyle-8.10.1-all.jar
49+
checkstyle-8.11-all.jar
5050
Automatic-Module-Name: net.sf.eclipsecs.checkstyle
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
bin.includes = META-INF/,\
22
.,\
33
license/,\
4-
checkstyle-8.10.1-all.jar
4+
checkstyle-8.11-all.jar
55
jars.compile.order = .
66
source.. = metadata/
10.5 MB
Binary file not shown.
5.93 MB
Binary file not shown.

net.sf.eclipsecs.checkstyle/metadata/com/puppycrawl/tools/checkstyle/checks/naming/checkstyle-metadata.properties

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,8 @@ AbbreviationAsWordInName.tokens = Tokens to check.
9191

9292
CatchParameterName.name = Catch Parameter Name
9393
CatchParameterName.desc = Checks that catch parameter names conform to a format specified by the format property. Default pattern has the following characteristic:<ul><li>allows names beginning with two lowercase letters followed by at least one uppercase or lowercase letter</li><li>allows e abbreviation (suitable for exceptions end errors)</li><li>allows ex abbreviation (suitable for exceptions)</li><li>allows t abbreviation (suitable for throwables)</li><li>prohibits numbered abbreviations like e1 or t2</li><li>prohibits one letter prefixes like pException</li><li>prohibits two letter abbreviations like ie or ee</li><li>prohibits any other characters than letters</li></ul>
94-
CatchParameterName.format = Specifies valid identifiers.
94+
CatchParameterName.format = Specifies valid identifiers.
95+
96+
LambdaParameterName.name = Lambda parameter names
97+
LambdaParameterName.desc = Checks that lambda parameter names follow naming convention.
98+
LambdaParameterName.format = Regular expression defining required naming pattern.

net.sf.eclipsecs.checkstyle/metadata/com/puppycrawl/tools/checkstyle/checks/naming/checkstyle-metadata.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,15 @@
269269
</property-metadata>
270270
<message-key key="name.invalidPattern"/>
271271
</rule-metadata>
272+
273+
<rule-metadata name="%LambdaParameterName.name" internal-name="LambdaParameterName" parent="TreeWalker">
274+
<alternative-name internal-name="com.puppycrawl.tools.checkstyle.checks.naming.LambdaParameterNameCheck"/>
275+
<description>%LambdaParameterName.desc</description>
276+
<property-metadata name="format" datatype="Regex" default-value="^[a-z][a-zA-Z0-9]*$">
277+
<description>%LambdaParameterName.format</description>
278+
</property-metadata>
279+
<message-key key="name.invalidPattern"/>
280+
</rule-metadata>
272281
</rule-group-metadata>
273282

274283
</checkstyle-metadata>

net.sf.eclipsecs.checkstyle/test/net/sf/eclipsecs/checkstyle/ChecksTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import static java.nio.charset.StandardCharsets.UTF_8;
44

55
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
6-
import com.puppycrawl.tools.checkstyle.utils.ModuleReflectionUtils;
6+
import com.puppycrawl.tools.checkstyle.utils.ModuleReflectionUtil;
77

88
import java.io.File;
99
import java.io.FileInputStream;
@@ -105,10 +105,10 @@ private static void validateEclipseCsMetaXmlFileRules(String packge, Set<Class<?
105105
final Node parentAttribute = attributes.getNamedItem("parent");
106106
final String parentValue;
107107

108-
if (ModuleReflectionUtils.isCheckstyleTreeWalkerCheck(module)
109-
|| ModuleReflectionUtils.isTreeWalkerFilterModule(module)) {
108+
if (ModuleReflectionUtil.isCheckstyleTreeWalkerCheck(module)
109+
|| ModuleReflectionUtil.isTreeWalkerFilterModule(module)) {
110110
parentValue = "TreeWalker";
111-
} else if (ModuleReflectionUtils.isRootModule(module)) {
111+
} else if (ModuleReflectionUtil.isRootModule(module)) {
112112
parentValue = "Root";
113113
} else {
114114
parentValue = "Checker";

net.sf.eclipsecs.checkstyle/test/net/sf/eclipsecs/checkstyle/utils/CheckUtil.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck;
99
import com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck;
1010
import com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck;
11-
import com.puppycrawl.tools.checkstyle.utils.JavadocUtils;
12-
import com.puppycrawl.tools.checkstyle.utils.ModuleReflectionUtils;
13-
import com.puppycrawl.tools.checkstyle.utils.TokenUtils;
11+
import com.puppycrawl.tools.checkstyle.utils.JavadocUtil;
12+
import com.puppycrawl.tools.checkstyle.utils.ModuleReflectionUtil;
13+
import com.puppycrawl.tools.checkstyle.utils.TokenUtil;
1414

1515
import java.beans.PropertyDescriptor;
1616
import java.lang.reflect.Field;
@@ -44,7 +44,7 @@ public static String getSimpleCheckstyleModuleName(Class<?> module) {
4444

4545
public static Set<Class<?>> getCheckstyleModules() throws Exception {
4646
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
47-
return ModuleReflectionUtils.getCheckstyleModules(PackageNamesLoader.getPackageNames(loader),
47+
return ModuleReflectionUtil.getCheckstyleModules(PackageNamesLoader.getPackageNames(loader),
4848
loader);
4949
}
5050

@@ -188,15 +188,15 @@ public static Set<Field> getCheckMessages(Class<?> module) throws ClassNotFoundE
188188

189189
public static String getTokenText(int[] tokens, int... subtractions) {
190190
String tokenText = null;
191-
if (subtractions.length == 0 && Arrays.equals(tokens, TokenUtils.getAllTokenIds())) {
191+
if (subtractions.length == 0 && Arrays.equals(tokens, TokenUtil.getAllTokenIds())) {
192192
tokenText = "TokenTypes";
193193
} else {
194194

195195
Arrays.sort(subtractions);
196196

197197
tokenText = Arrays.stream(tokens)
198198
.filter(token -> Arrays.binarySearch(subtractions, token) < 0)
199-
.mapToObj(TokenUtils::getTokenName).collect(Collectors.joining(","));
199+
.mapToObj(TokenUtil::getTokenName).collect(Collectors.joining(","));
200200
}
201201
return tokenText.length() == 0 ? null : tokenText;
202202
}
@@ -207,7 +207,7 @@ public static String getJavadocTokenText(int[] tokens, int... subtractions) {
207207

208208
String tokenText = Arrays.stream(tokens)
209209
.filter(token -> Arrays.binarySearch(subtractions, token) < 0)
210-
.mapToObj(JavadocUtils::getTokenName).collect(Collectors.joining(","));
210+
.mapToObj(JavadocUtil::getTokenName).collect(Collectors.joining(","));
211211

212212
if (tokenText.length() == 0) {
213213
tokenText = "empty";

0 commit comments

Comments
 (0)