Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checkstyle for JavaDoc and fix related issues #5288

Merged
merged 2 commits into from
Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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