Skip to content

Commit

Permalink
copying checkstyle to VIVO repository
Browse files Browse the repository at this point in the history
  • Loading branch information
chenejac committed Mar 1, 2023
1 parent 087284e commit d835760
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 2 deletions.
7 changes: 7 additions & 0 deletions checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.2//EN"
"http://checkstyle.sourceforge.net/dtds/suppressions_1_2.dtd">
<suppressions>

</suppressions>
109 changes: 109 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
<!--
Vitro CodeStyle Requirements
1. 4-space indents for Java. NO TABS ALLOWED.
2. One true brace style. Braces required on all blocks.
3. Do not use wildcard imports (e.g. import java.util.*). Duplicated or unused imports also not allowed.
4. Maximum line length is 100 characters (except for long URLs, packages or imports)
5. No trailing spaces allowed (except in comments)
6. Tokens should be surrounded by whitespace (see http://checkstyle.sourceforge.net/config_whitespace.html#WhitespaceAround)
7. Each line of code can only include one statement. This also means each variable declaration must be on its own line
8. Each source file must include our license header (validated separately by license-maven-plugin, see pom.xml)
For more information on CheckStyle configurations below, see: http://checkstyle.sourceforge.net/checks.html
-->
<module name="Checker">
<!-- Configure checker to use UTF-8 encoding -->
<property name="charset" value="UTF-8"/>
<!-- Configure checker to run on files with these extensions -->
<property name="fileExtensions" value="java, properties, cfg, xml, js, ftl, ttl, n3"/>

<!-- &lt;!&ndash; Suppression configurations in checkstyle-suppressions.xml in same directory &ndash;&gt;-->
<!-- <module name="SuppressionFilter">-->
<!-- <property name="file" value="${checkstyle.suppressions.file}" default="checkstyle-suppressions.xml"/>-->
<!-- </module>-->

<!-- &lt;!&ndash; No tab characters ('\t') allowed in the source code &ndash;&gt;-->
<!-- <module name="FileTabCharacter">-->
<!-- <property name="eachLine" value="true"/>-->
<!-- <property name="fileExtensions" value="java, properties, cfg, xml, js, ftl, ttl, n3"/>-->
<!-- </module>-->

<!-- &lt;!&ndash; No Trailing Whitespace, except on lines that only have an asterisk (e.g. comments) &ndash;&gt;-->
<!-- <module name="RegexpSingleline">-->
<!-- <property name="format" value="(?&lt;!\*)\s+$|\*\s\s+$"/>-->
<!-- <property name="message" value="Line has trailing whitespace"/>-->
<!-- <property name="fileExtensions" value="java, properties, cfg, css, js, xml"/>-->
<!-- </module>-->

<!-- &lt;!&ndash; Allow individual lines of code to be excluded from these rules, if they are annotated-->
<!-- with @SuppressWarnings. See also SuppressWarningsHolder below &ndash;&gt;-->
<!-- <module name="SuppressWarningsFilter" />-->

<!-- &lt;!&ndash; Maximum line length is 100 characters &ndash;&gt;-->
<!-- <module name="LineLength">-->
<!-- <property name="fileExtensions" value="java"/>-->
<!-- <property name="max" value="100"/>-->
<!-- &lt;!&ndash; Only exceptions for packages, imports, URLs, and JavaDoc {@link} tags &ndash;&gt;-->
<!-- <property name="ignorePattern" value="^package.*|^import.*|http://|https://|@link"/>-->
<!-- </module>-->

<!-- &lt;!&ndash; Check individual Java source files for specific rules &ndash;&gt;-->
<!-- <module name="TreeWalker">-->
<!-- &lt;!&ndash; Highlight any TODO or FIXME comments in info messages &ndash;&gt;-->
<!-- <module name="TodoComment">-->
<!-- <property name="severity" value="info"/>-->
<!-- <property name="format" value="(TODO)|(FIXME)"/>-->
<!-- </module>-->

<!-- &lt;!&ndash; Do not report errors on any lines annotated with @SuppressWarnings &ndash;&gt;-->
<!-- <module name="SuppressWarningsHolder"/>-->

<!-- &lt;!&ndash; ##### Import statement requirements ##### &ndash;&gt;-->
<!-- &lt;!&ndash; Star imports (e.g. import java.util.*) are NOT ALLOWED &ndash;&gt;-->
<!-- <module name="AvoidStarImport"/>-->
<!-- &lt;!&ndash; Redundant import statements are NOT ALLOWED &ndash;&gt;-->
<!-- <module name="RedundantImport"/>-->
<!-- &lt;!&ndash; Unused import statements are NOT ALLOWED &ndash;&gt;-->
<!-- <module name="UnusedImports"/>-->
<!-- &lt;!&ndash; Ensure imports appear alphabetically and grouped &ndash;&gt;-->
<!-- <module name="CustomImportOrder">-->
<!-- <property name="sortImportsInGroupAlphabetically" value="true"/>-->
<!-- <property name="separateLineBetweenGroups" value="true"/>-->
<!-- <property name="customImportOrderRules" value="STATIC###STANDARD_JAVA_PACKAGE###THIRD_PARTY_PACKAGE"/>-->
<!-- </module>-->

<!-- &lt;!&ndash; ##### Requirements for K&R Style braces ##### &ndash;&gt;-->
<!-- &lt;!&ndash; Code blocks MUST HAVE braces, even single line statements (if, while, etc) &ndash;&gt;-->
<!-- <module name="NeedBraces"/>-->
<!-- &lt;!&ndash; Left braces should be at the end of current line (default value)&ndash;&gt;-->
<!-- <module name="LeftCurly"/>-->
<!-- &lt;!&ndash; Right braces should be on start of a new line (default value) &ndash;&gt;-->
<!-- <module name="RightCurly"/>-->

<!-- &lt;!&ndash; ##### Indentation / Whitespace requirements ##### &ndash;&gt;-->
<!-- &lt;!&ndash; Require 4-space indentation (default value) &ndash;&gt;-->
<!-- <module name="Indentation"/>-->
<!-- &lt;!&ndash; Whitespace should exist around all major tokens &ndash;&gt;-->
<!-- <module name="WhitespaceAround">-->
<!-- &lt;!&ndash; However, make an exception for empty constructors, methods, types, etc. &ndash;&gt;-->
<!-- <property name="allowEmptyConstructors" value="true"/>-->
<!-- <property name="allowEmptyMethods" value="true"/>-->
<!-- <property name="allowEmptyTypes" value="true"/>-->
<!-- <property name="allowEmptyLoops" value="true"/>-->
<!-- </module>-->
<!-- &lt;!&ndash; Validate whitespace around Generics (angle brackets) per typical conventions-->
<!-- http://checkstyle.sourceforge.net/config_whitespace.html#GenericWhitespace &ndash;&gt;-->
<!-- <module name="GenericWhitespace"/>-->

<!-- &lt;!&ndash; ##### Other / Miscellaneous requirements ##### &ndash;&gt;-->
<!-- &lt;!&ndash; Require each variable declaration is its own statement on its own line &ndash;&gt;-->
<!-- <module name="MultipleVariableDeclarations"/>-->
<!-- &lt;!&ndash; Each line of code can only include one statement &ndash;&gt;-->
<!-- <module name="OneStatementPerLine"/>-->
<!-- </module>-->
</module>
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,10 @@
</executions>
<configuration>
<configLocation>
../Vitro/checkstyle.xml
checkstyle.xml
</configLocation>
<suppressionsLocation>
../Vitro/checkstyle-suppressions.xml
checkstyle-suppressions.xml
</suppressionsLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
Expand Down

0 comments on commit d835760

Please sign in to comment.