<module name="Checker">
- <module name="RegexpMultiline">
- <property name="format" value="System\.(out)|(err)\.print(ln)?\("/>
- <property name="message" value="Line contains console output."/>
- </module>
-
- <module name="RegexpMultiline">
- <property name="format" value="\.printStackTrace?\("/>
- <property name="message" value="Line contains printStacktrace()."/>
- </module>
-
<module name="TreeWalker">
<module name="org.opendaylight.yangtools.checkstyle.LoggerVariableNameCheck" />
</module>
<module name="org.opendaylight.yangtools.checkstyle.LoggerDeclarationsCountCheck"/>
</module>
- <module name="FileTabCharacter">
- <property name="eachLine" value="true"/>
- </module>
-
- <module name="RegexpSingleline">
- <property name="format" value="\s+$"/>
- <property name="message" value="Line has trailing spaces."/>
- </module>
-
- <module name="RegexpMultiline">
- <property name="format" value="(\r\n|\r)"/>
- <property name="message" value="Line has Windows line delimiter."/>
- </module>
-
- <module name="TreeWalker">
- <module name="Indentation">
- <property name="caseIndent" value="0"/>
- <property name="throwsIndent" value="8"/>
- </module>
-
- <module name="UnusedImports"/>
-
- <module name="ImportOrder">
- <property name="ordered" value="true"/>
- <property name="separated" value="true"/>
- <property name="option" value="above"/>
- </module>
- </module>
</module>
\ No newline at end of file
+++ /dev/null
-/*\r
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-\r
-package org.opendaylight.yangtools.checkstyle;\r
-\r
-import java.util.Comparator;\r
-import java.util.Map;\r
-\r
-import static java.lang.String.CASE_INSENSITIVE_ORDER;\r
-\r
-import com.google.common.collect.Maps;\r
-import com.google.common.collect.Lists;\r
-\r
-public class CheckCodingStyleTestClass {\r
- // NOTE: This test class contains intentional checkstyle issues\r
- public CheckCodingStyleTestClass() {\r
- Comparator<String> string = CASE_INSENSITIVE_ORDER; \r
- \r
- Map<String, String> map = Maps.newHashMap();\r
- }\r
-}\r
"16: LoggerFactory.getLogger Class argument is incorrect",
"18: Logger might be declared only once",
"17: Logger must be slf4j",
- "23: Line contains printStacktrace",
- "24: Line contains console output",
- "25: Line contains console output",
"27: Log message placeholders count is incorrect",
"33: Log message placeholders count is incorrect",
"42: Log message contains string concatenation");
}
- @Test
- public void testCodingChecks() throws Exception {
- verify(CheckCodingStyleTestClass.class, false,
- "9: Line has Windows line delimiter.",
- "14: Wrong order for",
- "24:1: Line contains a tab character.",
- "22: Line has trailing spaces.",
- "22: 'ctor def' child have incorrect indentation level 16, expected level should be 8.",
- "17:8: Unused import",
- "23: Line has trailing spaces.");
- }
private void verify(final Class<?> testClass, final boolean checkCount, final String... expectedMessages) throws CheckstyleException {
final String filePath = System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "java" + File.separator + testClass.getName().replaceAll("\\.", "/") + ".java";