Skip to content

Commit

Permalink
update checkstyle config
Browse files Browse the repository at this point in the history
and perform the necessary cleanups
  • Loading branch information
mtf90 committed Oct 6, 2023
1 parent d6e4db1 commit 062a597
Show file tree
Hide file tree
Showing 65 changed files with 198 additions and 187 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
*
* @see net.automatalib.ts
*/
package net.automatalib.automata;
package net.automatalib.automata;
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ public boolean getNodeProperties(S node, Map<String, String> properties) {
return true;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ public <I> GrowingAlphabetNotSupportedException(Alphabet<I> alphabet) {
super("The alphabet '" + alphabet + "' does not support growing");
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

import net.automatalib.graphs.concepts.EdgeLabels;

public interface FiniteLabeledGraph<N, E, L> extends Graph<N, E>, EdgeLabels<E, L> {}
public interface FiniteLabeledGraph<N, E, L> extends Graph<N, E>, EdgeLabels<E, L> {}
2 changes: 1 addition & 1 deletion api/src/main/java/net/automatalib/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
*
* @see net.automatalib.AutomataLibSettings
*/
package net.automatalib;
package net.automatalib;
12 changes: 6 additions & 6 deletions api/src/test/java/net/automatalib/words/AbstractWordTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ public void testIterator() {
Assert.assertFalse(it.hasNext());
}

@Test(expectedExceptions = {IndexOutOfBoundsException.class})
@Test(expectedExceptions = IndexOutOfBoundsException.class)
public void testSubword1() {
testWord.subWord(-1, testWord.length());
}

@Test(expectedExceptions = {IndexOutOfBoundsException.class})
@Test(expectedExceptions = IndexOutOfBoundsException.class)
public void testSubword2() {
testWord.subWord(0, testWord.length() + 1);
}
Expand All @@ -244,12 +244,12 @@ public void testPrefix() {
}
}

@Test(expectedExceptions = {IndexOutOfBoundsException.class})
@Test(expectedExceptions = IndexOutOfBoundsException.class)
public void testPrefix1() {
testWord.prefix(testWord.length() + 1);
}

@Test(expectedExceptions = {IndexOutOfBoundsException.class})
@Test(expectedExceptions = IndexOutOfBoundsException.class)
public void testPrefix2() {
testWord.prefix(-testWord.length() - 1);
}
Expand All @@ -271,12 +271,12 @@ public void testSuffix() {
}
}

@Test(expectedExceptions = {IndexOutOfBoundsException.class})
@Test(expectedExceptions = IndexOutOfBoundsException.class)
public void testSuffix1() {
testWord.suffix(testWord.length() + 1);
}

@Test(expectedExceptions = {IndexOutOfBoundsException.class})
@Test(expectedExceptions = IndexOutOfBoundsException.class)
public void testSuffix2() {
testWord.suffix(-testWord.length() - 1);
}
Expand Down
2 changes: 1 addition & 1 deletion api/src/test/resources/automatalib.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ automatalib.word.delim.right=delim_right
automatalib.word.empty=empty_rep
automatalib.word.symbol.delim.left=symbol_delim_left
automatalib.word.symbol.delim.right=symbol_delim_right
automatalib.word.symbol.separator=symbol_sep
automatalib.word.symbol.separator=symbol_sep
199 changes: 106 additions & 93 deletions build-tools/src/main/resources/automatalib-learnlib-checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,87 +47,20 @@ limitations under the License.

<module name="FileTabCharacter"/>
<module name="UniqueProperties"/>
<module name="NewlineAtEndOfFile"/>

<module name="TreeWalker">

<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
</module>
<module name="JavadocStyle"/>
<module name="NonEmptyAtclauseDescription"/>
<module name="AbstractClassName"/>
<module name="ClassTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$"/>
</module>

<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName">
<property name="format" value="^[a-zA-Z][a-zA-Z0-9]*$"/>
</module>
<module name="LocalVariableName">
<property name="format" value="^[a-zA-Z][a-zA-Z0-9]*$"/>
</module>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="MethodTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$"/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$"/>
</module>
<module name="PackageName"/>
<module name="ParameterName">
<property name="accessModifiers" value="public"/>
</module>
<module name="StaticVariableName">
<property name="format" value="^[a-zA-Z][a-zA-Z0-9]*$"/>
</module>
<module name="TypeName"/>
<!-- https://checkstyle.org/checks/annotation/index.html -->
<module name="AnnotationUseStyle"/>
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>

<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_imports.html -->
<module name="AvoidStarImport"/>
<module name="AvoidStaticImport"/>
<module name="IllegalImport"/>
<module name="ImportOrder">
<property name="groups" value="/^java\./,javax,*"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="AnonInnerLength">
<property name="max" value="100"/>
</module>
<module name="OuterTypeNumber"/>

<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="GenericWhitespace"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="WhitespaceAfter"/>
<module name="SingleSpaceSeparator">
<property name="validateComments" value="true"/>
</module>

<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>

<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<!-- https://checkstyle.org/checks/blocks/index.html -->
<module name="AvoidNestedBlocks">
<property name="allowInSwitchCase" value="true"/>
</module>
<module name="EmptyCatchBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly">
Expand All @@ -141,18 +74,28 @@ limitations under the License.
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, INSTANCE_INIT"/>
</module>

<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<!-- https://checkstyle.org/checks/design/index.html -->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InnerTypeLast"/>
<module name="InterfaceIsType"/>
<module name="MutableException"/>
<module name="OneTopLevelClass"/>

<!-- https://checkstyle.org/checks/coding/index.html -->
<module name="AvoidDoubleBraceInitialization"/>
<module name="AvoidNoArgumentSuperConstructorCall"/>
<module name="CovariantEquals"/>
<module name="DefaultComesLast"/>
<module name="DeclarationOrder">
<property name="ignoreModifiers" value="true"/>
</module>
<module name="DefaultComesLast"/>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull "/>
<module name="EqualsHashCode"/>
<module name="ExplicitInitialization"/>
<module name="IllegalCatch">
<property name="illegalClassNames" value="java.lang.Exception, java.lang.Throwable"/>
<property name="illegalClassNames" value="Error, Exception, Throwable, java.lang.Error, java.lang.Exception, java.lang.Throwable"/>
</module>
<module name="IllegalThrows"/>
<module name="InnerAssignment"/>
Expand All @@ -163,32 +106,102 @@ limitations under the License.
<property name="ignoreHashCodeMethod" value="true"/>
</module>
<module name="MissingSwitchDefault"/>
<module name="NoArrayTrailingComma"/>
<module name="OneStatementPerLine"/>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="PackageDeclaration"/>
<module name="ParameterAssignment"/>
<module name="RequireThis"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="OneStatementPerLine"/>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<module name="UnnecessarySemicolonInEnumeration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
<module name="UnusedLocalVariable"/>

<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<module name="FinalClass"/>
<module name="InnerTypeLast"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="MutableException"/>
<module name="OneTopLevelClass"/>
<!-- https://checkstyle.org/checks/imports/index.html -->
<module name="AvoidStarImport"/>
<module name="AvoidStaticImport"/>
<module name="IllegalImport"/>
<module name="ImportOrder">
<property name="groups" value="/^java\./,javax,*"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>

<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<!-- https://checkstyle.org/checks/javadoc/index.html -->
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
</module>
<module name="InvalidJavadocPosition"/>
<module name="JavadocContentLocation"/>
<module name="JavadocMissingLeadingAsterisk"/>
<module name="JavadocMissingWhitespaceAfterAsterisk"/>
<module name="JavadocStyle"/>
<module name="NonEmptyAtclauseDescription"/>
<module name="RequireEmptyLineBeforeBlockTagGroup"/>

<!-- https://checkstyle.org/checks/misc/index.html -->
<module name="ArrayTypeStyle"/>
<module name="CommentsIndentation"/>
<module name="UpperEll"/>
<module name="OuterTypeFilename"/>
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="CommentsIndentation"/>
<module name="OuterTypeFilename"/>
<module name="UpperEll"/>

<!-- https://checkstyle.org/checks/modifier/index.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>

<!-- https://checkstyle.org/checks/naming/index.html -->
<module name="AbstractClassName"/>
<module name="ClassTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$"/>
</module>
<module name="ConstantName"/>
<module name="InterfaceTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$"/>
</module>
<module name="LambdaParameterName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="MethodTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$"/>
</module>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName">
<property name="format" value="^[a-zA-Z][a-zA-Z0-9]*$"/>
</module>
<module name="TypeName"/>

<!-- https://checkstyle.org/checks/sizes/index.html -->
<module name="AnonInnerLength">
<property name="max" value="100"/>
</module>
<module name="OuterTypeNumber"/>

<!-- https://checkstyle.org/checks/whitespace/index.html -->
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="SingleSpaceSeparator">
<property name="validateComments" value="true"/>
</module>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>

</module>

</module>
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
*/
public class InvalidReferenceException extends IllegalArgumentException {

/**
* Default constructor.
*/
public InvalidReferenceException() {
super();
}

/**
* Constructor.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public interface SmartCollection<E> extends Collection<E> {
* This function is deprecated and should not be used, in favor of the removal by reference {@link
* #remove(ElementReference)}.
*
* @see Collection#remove(Object)
* @deprecated use {@link #remove(ElementReference)} instead
*/
@Deprecated
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ public interface SmartDeque<E> extends SmartCollection<E> {
*/
E popBack();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ public interface SmartPriorityQueue<E> extends SmartCollection<E> {
*/
E extractMin();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,4 @@ private void loadSystemLibrary(String name) {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ private int getIntSuccessor(int state, Iterable<? extends I> input) {

return current;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@ public ProceduralInputAlphabet<I> getInputAlphabet() {
public Map<I, DFA<?, I>> getProcedures() {
return Collections.unmodifiableMap(procedures);
}
}
}
Loading

0 comments on commit 062a597

Please sign in to comment.