Skip to content

Commit

Permalink
Merge pull request #5288 from JabRef/javadocCheckstyle
Browse files Browse the repository at this point in the history
Add checkstyle for JavaDoc and fix related issues
  • Loading branch information
Siedlerchr committed Sep 9, 2019
2 parents fc4201d + 502f400 commit 8a5feb4
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 92 deletions.
43 changes: 26 additions & 17 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,30 @@
<property name="header" value=""/>
</module>

<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>

<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>

<module name="TreeWalker">
<!-- Checks for Javadoc comments: https://checkstyle.org/config_javadoc.html -->
<module name="InvalidJavadocPosition"/>
<module name="JavadocMethod">
<property name="allowUndeclaredRTE" value="true"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="validateThrows" value="true"/>
</module>

<!-- Checks for imports: https://checkstyle.org/config_import.html -->
<module name="UnusedImports"/>

<module name="RedundantImport"/>

<module name="AvoidStarImport"/>

<module name="IllegalImport"/>

<module name="ImportOrder">
<property name="groups" value="java,javax,javafx,org.jabref,*"/>
<property name="ordered" value="true"/>
Expand All @@ -26,17 +40,18 @@
<property name="sortStaticImportsAlphabetically" value="true"/>
</module>

<!-- Checks for common coding problems: https://checkstyle.org/config_coding.html -->
<module name="DeclarationOrder"/>

<!-- Checks for whitespace: https://checkstyle.org/config_whitespace.html -->
<module name="EmptyLineSeparator">
<property name="tokens"
value="IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF, STATIC_INIT, INSTANCE_INIT, METHOD_DEF"/>
<property name="allowMultipleEmptyLines" value="false"/>
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
</module>

<module name="DeclarationOrder"/>

<!-- RCULRY causes issues if classes are nested within arrays, therefore not activated -->
<module name="WhitespaceAround">
<!-- RCULRY causes issues if classes are nested within arrays, therefore not activated -->
<property name="tokens"
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV,
DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE,
Expand All @@ -46,18 +61,12 @@
SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
</module>

<!-- Checks for Naming Conventions: https://checkstyle.org/config_naming.html -->
<module name="ConstantName">
<property name="format" value="^log(ger)?|[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
</module>

<module name="NeedBraces"/>
</module>

<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>

<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
<!-- Checks for blocks: https://checkstyle.org/config_blocks.html -->
<module name="NeedBraces"/>
</module>
</module>
5 changes: 1 addition & 4 deletions src/main/java/org/jabref/gui/util/RecursiveTreeItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
import javafx.util.Callback;

/**
* Taken from https://gist.github.com/lestard/011e9ed4433f9eb791a8
*/

/**
* @implNote Taken from https://gist.github.com/lestard/011e9ed4433f9eb791a8
* @implNote As CheckBoxTreeItem extends TreeItem, this class will work for both.
*/
public class RecursiveTreeItem<T> extends CheckBoxTreeItem<T> {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/logic/bst/BibtexCaseChanger.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private String doChangeCase(String s, FORMAT_MODE format) {
* special with |colon|s.
*
* @param c
* @param i the current position. It points to the opening brace
* @param start the current position. It points to the opening brace
* @param format
* @return
*/
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/org/jabref/logic/bst/BibtexWidth.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,6 @@ public static int getCharWidth(char c) {
}
}

/**
*
* @param toMeasure
* @param warn
* may-be-null
* @return
*/
public static int width(String toMeasure) {

/*
Expand Down
Loading

0 comments on commit 8a5feb4

Please sign in to comment.