Skip to content

Commit

Permalink
Merge pull request #316 from KyleAure/style-and-formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAure authored Aug 11, 2023
2 parents a9bf4ac + 821ce06 commit 1158396
Show file tree
Hide file tree
Showing 174 changed files with 8,405 additions and 8,167 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,5 @@ jobs:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- name: Build API and TCK
- name: Build API, SPEC, and TCK
run: mvn -B install --file pom.xml
- name: Build SPEC
run: mvn -B package --file specification/pom.xml
- name: Build TCK-DIST
run: mvn -B package --file tck-dist/pom.xml
214 changes: 105 additions & 109 deletions api/etc/config/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2010, 2023 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -17,7 +17,9 @@
-->

<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
This file is based on maven-checkstyle-plugin config/sun_checks.xml file.
Expand Down Expand Up @@ -51,6 +53,22 @@
<property name="basedir" value="${basedir}"/>
-->

<module name="FileLength">
<property name="max" value="3500"/>
<property name="fileExtensions" value="java"/>
</module>

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<property name="max" value="180"/>
<property name="ignorePattern" value="@link|@version|@see|@todo|TODO|resource-env-ref-type"/>
</module>

<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>

<!-- Checks that each Java package has a Javadoc file used for commenting. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
Expand All @@ -64,74 +82,50 @@
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation"/>

<module name="FileLength"/>

<!-- Following interprets the header file as regular expressions. -->
<!-- <module name="RegexpHeader"/> -->

<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>

<module name="RegexpSingleline">
<property name="format" value="\S+\s+$"/>
<property name="message" value="Non-empty line has trailing spaces."/>
</module>

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<property name="max" value="120"/>
<property name="ignorePattern" value="@link|@version|@see|@todo|TODO|resource-env-ref-type"/>
</module>

<module name="TreeWalker">
<property name="tabWidth" value="4"/>


<module name="SuppressionCommentFilter"/>

<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName">
<property name="format" value="^(_?[a-z][a-zA-Z0-9]*|([A-Z](_?[A-Z0-9]+)*))$"/>
</module>
<module name="LocalVariableName"/>
<module name="MethodName">
<property name="format" value="^_?[a-z][a-zA-Z0-9]*$"/>
</module>
<module name="PackageName"/>
<module name="LocalFinalVariableName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName">
<property name="format" value="^_?[A-Z][a-zA-Z0-9]*$"/>
</module>
<module name="MemberName"/>

<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="JavadocMethod">
<property name="scope" value="protected"/>
<!-- ANNOTATION_FIELD_DEF is disabled below because checkstyle is erroneously reporting
JavadocMethod "Unused Javadoc tag" for @return on annotation methods -->
<property name="tokens" value="CTOR_DEF,METHOD_DEF"/>
</module>
<module name="JavadocType">
<property name="scope" value="protected"/>
</module>
<module name="JavadocVariable">
<property name="scope" value="protected"/>
<property name="scope" value="package"/>
</module>
<module name="JavadocStyle"/>


<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>


<!-- Checks for Headers -->
<!-- See http://checkstyle.sf.net/config_header.html -->
<!-- <module name="Header"> -->
<!-- The follow property value demonstrates the ability -->
<!-- to have access to ANT properties. In this case it uses -->
<!-- the ${basedir} property to allow Checkstyle to be run -->
<!-- from any directory within a project. See property -->
<!-- expansion, -->
<!-- http://checkstyle.sf.net/config.html#properties -->
<!-- <property -->
<!-- name="headerFile" -->
<!-- value="${basedir}/java.header"/> -->
<!-- </module> -->

<property name="tabWidth" value="4"/>

<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
Expand All @@ -140,81 +134,51 @@
<module name="RedundantImport"/>
<module name="UnusedImports"/>



<module name="MethodLength"/>
<module name="ParameterNumber">
<property name="max" value="9"/>
<module name="MethodLength">
<property name="max" value="250"/>
</module>


<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<!--property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS" />
</module-->
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround">
<property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR,
BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV,
DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT,
LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY,
LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED,
LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD,
MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL,
SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN,
TYPE_EXTENSION_AND, GENERIC_START, GENERIC_END" /> <!-- RCURLY removed -->
<module name="ParameterNumber">
<property name="max" value="15"/>
</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 -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>


<module name="EmptyBlock">
<property name="option" value="text"/>
</module>
<module name="NeedBraces">
<property name="tokens"
value="LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE"/>
</module>
<module name="LeftCurly">
<property name="option" value="EOL"/>
</module>
<module name="RightCurly">
<property name="option" value="SAME"/>
</module>

<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<!-- module name="AvoidInlineConditionals"/-->
<!--module name="DoubleCheckedLocking"/-->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="DefaultComesLast"/>
<module name="MissingSwitchDefault"/>
<module name="FallThrough"/>
<module name="MultipleVariableDeclarations"/>
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true"/>
<property name="ignoreSetter" value="true"/>
</module>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<!--
Unable to use MagicNumber until maven plugin supports Checkstyle 5.3
or, at least, until Checkstyle 5.3 is available in a maven repository
<module name="MagicNumber">
<property name="ignoreHashCodeMethod" value="true"/>
</module-->
<module name="MissingSwitchDefault"/>
<!--<module name="RedundantThrows">
<property name="allowUnchecked" value="true"/>

<module name="com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck">
<property name="severity" value="ignore"/>
</module>
-->
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>



<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<!--module name="DesignForExtension"/-->
Expand All @@ -225,14 +189,46 @@
<module name="ThrowsCount">
<property name="max" value="3"/>
</module>




<module name="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck">
<property name="packageAllowed" value="false"/>
<property name="protectedAllowed" value="true"/>
<property name="publicMemberPattern" value="^serialVersionUID"/>
<property name="severity" value="warning"/>
</module>

<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/>
<module name="FinalParameters"/>
<module name="TodoComment"/>
<module name="UpperEll"/>

<module name="AnnotationLocation">
<property name="allowSamelineMultipleAnnotations" value="false"/>
<property name="allowSamelineSingleParameterlessAnnotation" value="false"/>
<property name="allowSamelineParameterizedAnnotation" value="false"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, ANNOTATION_DEF"/>
</module>

<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>

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

</module>
</module>
20 changes: 0 additions & 20 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -236,26 +236,6 @@ Use is subject to <a href="{@docRoot}/doc-files/speclicense.html" target="_top">
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<source>17</source>
<outputDirectory>${project.build.directory}/checkstyle</outputDirectory>
<outputFile>${project.build.directory}/checkstyle/checkstyle-result.xml</outputFile>
<configLocation>etc/config/checkstyle.xml</configLocation>
<excludes>**/module-info.java</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>checkstyle</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
Expand Down
Loading

0 comments on commit 1158396

Please sign in to comment.