2019-06-08 00:28:03 +01:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2023-03-15 21:52:13 +00:00
|
|
|
|
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: 2019 The CC: Tweaked Developers
|
|
|
|
|
|
|
|
SPDX-License-Identifier: MPL-2.0
|
|
|
|
-->
|
|
|
|
|
2019-06-08 00:28:03 +01:00
|
|
|
<!DOCTYPE module PUBLIC
|
|
|
|
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
|
|
|
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
|
|
|
<module name="Checker">
|
|
|
|
<property name="tabWidth" value="4"/>
|
|
|
|
<property name="charset" value="UTF-8" />
|
|
|
|
|
2024-03-13 21:52:09 +00:00
|
|
|
<module name="BeforeExecutionExclusionFileFilter">
|
|
|
|
<property name="fileNamePattern" value="module\-info\.java$"/>
|
|
|
|
</module>
|
|
|
|
|
2019-06-08 00:28:03 +01:00
|
|
|
<module name="SuppressionFilter">
|
2024-03-13 21:52:09 +00:00
|
|
|
<property name="file" value="${config_loc}/suppressions.xml" />
|
2019-06-08 00:28:03 +01:00
|
|
|
</module>
|
|
|
|
|
2020-01-22 11:14:30 +00:00
|
|
|
<module name="BeforeExecutionExclusionFileFilter">
|
|
|
|
<property name="fileNamePattern" value="render_old"/>
|
|
|
|
</module>
|
|
|
|
|
2019-06-08 00:28:03 +01:00
|
|
|
<module name="TreeWalker">
|
|
|
|
<!-- Annotations -->
|
|
|
|
<module name="AnnotationLocation" />
|
2022-11-06 10:28:49 +00:00
|
|
|
<module name="AnnotationUseStyle">
|
|
|
|
<!-- We want trailing commas on multiline arrays. -->
|
|
|
|
<property name="trailingArrayComma" value="ignore" />
|
|
|
|
</module>
|
2019-10-27 15:16:47 +00:00
|
|
|
<module name="MissingDeprecated" />
|
2019-06-08 00:28:03 +01:00
|
|
|
<module name="MissingOverride" />
|
|
|
|
|
|
|
|
<!-- Blocks -->
|
|
|
|
<module name="EmptyBlock" />
|
|
|
|
<module name="EmptyCatchBlock">
|
|
|
|
<property name="exceptionVariableName" value="ignored" />
|
|
|
|
</module>
|
|
|
|
<module name="LeftCurly" />
|
|
|
|
<module name="NeedBraces">
|
|
|
|
<property name="allowSingleLineStatement" value="true"/>
|
|
|
|
</module>
|
|
|
|
<module name="RightCurly" />
|
|
|
|
|
|
|
|
<!-- Class design. As if we've ever followed good practice here. -->
|
|
|
|
<module name="FinalClass" />
|
|
|
|
<module name="InterfaceIsType" />
|
|
|
|
<module name="MutableException" />
|
|
|
|
<module name="OneTopLevelClass" />
|
|
|
|
|
|
|
|
<!-- Coding -->
|
|
|
|
<module name="ArrayTrailingComma" />
|
|
|
|
<module name="EqualsHashCode" />
|
|
|
|
<!-- FallThrough does not handle unreachable code well -->
|
|
|
|
<module name="IllegalInstantiation" />
|
|
|
|
<module name="IllegalThrows" />
|
|
|
|
<module name="ModifiedControlVariable" />
|
|
|
|
<module name="NoClone" />
|
|
|
|
<module name="NoFinalizer" />
|
|
|
|
<module name="OneStatementPerLine" />
|
|
|
|
<module name="PackageDeclaration" />
|
|
|
|
<module name="SimplifyBooleanExpression" />
|
|
|
|
<module name="SimplifyBooleanReturn" />
|
|
|
|
<module name="StringLiteralEquality" />
|
2021-08-08 12:44:56 +01:00
|
|
|
<module name="UnnecessaryParentheses">
|
|
|
|
<!-- Default minus LAND. -->
|
|
|
|
<property name="tokens" value="EXPR,IDENT,NUM_DOUBLE,NUM_FLOAT,NUM_INT,NUM_LONG,STRING_LITERAL,LITERAL_NULL,LITERAL_FALSE,LITERAL_TRUE,ASSIGN,BAND_ASSIGN,BOR_ASSIGN,BSR_ASSIGN,BXOR_ASSIGN,DIV_ASSIGN,MINUS_ASSIGN,MOD_ASSIGN,PLUS_ASSIGN,SL_ASSIGN,SR_ASSIGN,STAR_ASSIGN,LAMBDA,TEXT_BLOCK_LITERAL_BEGIN,LITERAL_INSTANCEOF,GT,LT,GE,LE,EQUAL,NOT_EQUAL,UNARY_MINUS,UNARY_PLUS,INC,DEC,LNOT,BNOT,POST_INC,POST_DEC" />
|
|
|
|
</module>
|
2019-10-27 15:16:47 +00:00
|
|
|
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration" />
|
|
|
|
<module name="UnnecessarySemicolonInTryWithResources" />
|
|
|
|
<module name="UnnecessarySemicolonInEnumeration" />
|
2019-06-08 00:28:03 +01:00
|
|
|
|
|
|
|
<!-- Imports -->
|
2021-08-08 12:44:56 +01:00
|
|
|
<module name="CustomImportOrder">
|
|
|
|
<property name="customImportOrderRules"
|
|
|
|
value="THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE###STATIC"
|
|
|
|
/>
|
|
|
|
</module>
|
2019-06-08 00:28:03 +01:00
|
|
|
<module name="IllegalImport" />
|
|
|
|
<module name="RedundantImport" />
|
|
|
|
<module name="UnusedImports" />
|
|
|
|
|
|
|
|
<!-- Javadoc -->
|
2019-10-27 15:16:47 +00:00
|
|
|
<!-- TODO: Missing* checks for the dan200.computercraft.api package? -->
|
2022-10-30 10:50:16 +00:00
|
|
|
<module name="AtclauseOrder">
|
|
|
|
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
|
|
|
|
</module>
|
2019-10-27 15:16:47 +00:00
|
|
|
<module name="InvalidJavadocPosition" />
|
|
|
|
<module name="JavadocBlockTagLocation" />
|
|
|
|
<module name="JavadocMethod"/>
|
|
|
|
<module name="JavadocType"/>
|
2022-06-01 00:47:00 +01:00
|
|
|
<module name="JavadocStyle">
|
|
|
|
<property name="checkHtml" value="false" />
|
|
|
|
</module>
|
2019-06-08 00:28:03 +01:00
|
|
|
<module name="NonEmptyAtclauseDescription" />
|
|
|
|
<module name="SingleLineJavadoc" />
|
2019-10-27 15:16:47 +00:00
|
|
|
<module name="SummaryJavadocCheck"/>
|
2019-06-08 00:28:03 +01:00
|
|
|
|
|
|
|
<!-- Misc -->
|
|
|
|
<module name="ArrayTypeStyle" />
|
|
|
|
<module name="CommentsIndentation" />
|
|
|
|
<module name="Indentation" />
|
|
|
|
<module name="OuterTypeFilename" />
|
|
|
|
|
|
|
|
<!-- Modifiers -->
|
|
|
|
<module name="ModifierOrder" />
|
|
|
|
<module name="RedundantModifier" />
|
|
|
|
|
|
|
|
<!-- Naming -->
|
|
|
|
<module name="ClassTypeParameterName" />
|
|
|
|
<module name="InterfaceTypeParameterName" />
|
|
|
|
<module name="LambdaParameterName" />
|
|
|
|
<module name="LocalFinalVariableName" />
|
|
|
|
<module name="LocalVariableName" />
|
Split ComputerThread/ComputerExecutor up a little
This is an attempt to enforce better separation between ComputerThread
and ComputerExecutor. Both of these classes are pretty complex in their
own right, and the way the two bleed into each other makes it all the
more confusing!
This effectively splits the ComputerExecutor into two separate classes:
- ComputerScheduler.Executor (with the actual implementation inside
ComputerThread): This holds all the ComputerThread-related logic
which used to be in ComputerExecutor, including:
- before/after work hooks
- is-on-thread tracking
- virtual runtime computation
- ComputerScheduler.Worker: This encapsulates all the computer-related
behaviour. The actual implementation remains in ComputerExecutor.
The boundaries are still a little fuzzy here, and it's all definitely
more coupled then I'd like, but still an improvement!
There are several additional changes at the same time:
- TimeoutState has also been split up, to better define the boundary
between consumers (such as ComputerExecutor and ILuaMachine) and
controllers (ComputerThread).
The getters still live in TimeoutState, but the core logic lives in
ManagedTimeoutState.
- We no longer track cumulative time in the TimeoutState. Instead, we
allow varying the timeout of a computer. When a computer is paused,
we store the remaining time, and restore it when resuming again.
This also allows us give a longer timeout for computer
startup/shutdown, hopefully avoiding some of those class-not-found
issues we've seen.
- We try to make the state machine of how ComputerExecutors live on the
queue a little more explicit. This is very messy/confusing -
something I want to property test in the future.
I'm sure there's more to be done here, especially in ComputerExecutor,
but hopefully this makes future changes a little less intimidating.
2023-10-19 22:48:46 +01:00
|
|
|
<module name="MemberName">
|
|
|
|
<property name="format" value="^\$?[a-z][a-zA-Z0-9]*$" />
|
|
|
|
</module>
|
2022-10-30 10:50:16 +00:00
|
|
|
<module name="MethodName">
|
|
|
|
<property name="format" value="^(computercraft\$)?[a-z][a-zA-Z0-9]*$" />
|
|
|
|
</module>
|
2019-06-08 00:28:03 +01:00
|
|
|
<module name="MethodTypeParameterName" />
|
|
|
|
<module name="PackageName">
|
Clean up Javadocs a little
I've no motivation for modding right now, but always got time for build
system busywork!
CC:T (and CC before that) has always published its API docs. However,
they're not always the most helpful — they're useful if you know what
you're looking for, but aren't a good getting-started guide.
Part of the issue here is there's no examples, and everything is
described pretty abstractly. I have occasionally tried to improve this
(e.g. the peripheral docs in bdffabc08e2eb9895f966c949acc8334a2bf4475),
but it's a long road.
This commit adds a new example mod, which registers peripherals, an API
and a turtle upgrade. While the mod itself isn't exported as part of the
docs, we reference blocks of it using Java's new {@snippet} tag.
- Switch the Forge project to use NeoForge's new Legacy MDG plugin. We
don't *need* to do this, but it means the build logic for Forge and
NeoForge is more closely aligned.
- Add a new SnippetTaglet, which is a partial backport of Java 18+'s
{@snippet}.
- Add an example mod. This is a working multi-loader mod, complete with
datagen (albeit with no good multi-loader abstractions).
- Move our existing <pre>{@code ...}</pre> blocks into the example mod,
replacing them with {@snippet}s.
- Add a new overview page to the docs, providing some getting-started
information. We had this already in the dan200.computercraft.api
package docs, but it's not especially visible there.
2025-01-09 20:47:51 +00:00
|
|
|
<property name="format" value="^(dan200\.computercraft|cc\.tweaked|com\.example\.examplemod)(\.[a-z][a-z0-9]*)*" />
|
2019-06-08 00:28:03 +01:00
|
|
|
</module>
|
|
|
|
<module name="ParameterName" />
|
|
|
|
<module name="StaticVariableName">
|
Split ComputerThread/ComputerExecutor up a little
This is an attempt to enforce better separation between ComputerThread
and ComputerExecutor. Both of these classes are pretty complex in their
own right, and the way the two bleed into each other makes it all the
more confusing!
This effectively splits the ComputerExecutor into two separate classes:
- ComputerScheduler.Executor (with the actual implementation inside
ComputerThread): This holds all the ComputerThread-related logic
which used to be in ComputerExecutor, including:
- before/after work hooks
- is-on-thread tracking
- virtual runtime computation
- ComputerScheduler.Worker: This encapsulates all the computer-related
behaviour. The actual implementation remains in ComputerExecutor.
The boundaries are still a little fuzzy here, and it's all definitely
more coupled then I'd like, but still an improvement!
There are several additional changes at the same time:
- TimeoutState has also been split up, to better define the boundary
between consumers (such as ComputerExecutor and ILuaMachine) and
controllers (ComputerThread).
The getters still live in TimeoutState, but the core logic lives in
ManagedTimeoutState.
- We no longer track cumulative time in the TimeoutState. Instead, we
allow varying the timeout of a computer. When a computer is paused,
we store the remaining time, and restore it when resuming again.
This also allows us give a longer timeout for computer
startup/shutdown, hopefully avoiding some of those class-not-found
issues we've seen.
- We try to make the state machine of how ComputerExecutors live on the
queue a little more explicit. This is very messy/confusing -
something I want to property test in the future.
I'm sure there's more to be done here, especially in ComputerExecutor,
but hopefully this makes future changes a little less intimidating.
2023-10-19 22:48:46 +01:00
|
|
|
<property name="format" value="^[a-z][a-zA-Z0-9]*$" />
|
2019-06-08 00:28:03 +01:00
|
|
|
</module>
|
|
|
|
<module name="TypeName" />
|
|
|
|
|
|
|
|
<!-- Whitespace -->
|
|
|
|
<module name="EmptyForInitializerPad"/>
|
|
|
|
<module name="EmptyForIteratorPad">
|
|
|
|
<property name="option" value="space"/>
|
|
|
|
</module>
|
|
|
|
<module name="GenericWhitespace" />
|
|
|
|
<module name="MethodParamPad" />
|
|
|
|
<module name="NoLineWrap" />
|
|
|
|
<module name="NoWhitespaceAfter">
|
|
|
|
<property name="tokens" value="AT,INC,DEC,UNARY_MINUS,UNARY_PLUS,BNOT,LNOT,DOT,ARRAY_DECLARATOR,INDEX_OP,METHOD_REF" />
|
|
|
|
</module>
|
|
|
|
<module name="NoWhitespaceBefore" />
|
|
|
|
<!-- TODO: Decide on an OperatorWrap style. -->
|
|
|
|
<module name="ParenPad" />
|
|
|
|
<module name="SeparatorWrap">
|
|
|
|
<property name="option" value="eol" />
|
|
|
|
<property name="tokens" value="COMMA,SEMI,ELLIPSIS,ARRAY_DECLARATOR,RBRACK,METHOD_REF" />
|
|
|
|
</module>
|
|
|
|
<module name="SeparatorWrap">
|
|
|
|
<property name="option" value="nl" />
|
|
|
|
<property name="tokens" value="DOT,AT" />
|
|
|
|
</module>
|
|
|
|
<module name="SingleSpaceSeparator" />
|
|
|
|
<module name="TypecastParenPad" />
|
|
|
|
<module name="WhitespaceAfter">
|
|
|
|
<property name="tokens" value="COMMA" />
|
|
|
|
</module>
|
|
|
|
<module name="WhitespaceAround">
|
|
|
|
<property name="ignoreEnhancedForColon" value="false" />
|
2021-11-21 11:19:02 +00:00
|
|
|
<!-- Allow empty functions -->
|
|
|
|
<property name="allowEmptyLambdas" value="true" />
|
|
|
|
<property name="allowEmptyMethods" value="true" />
|
2019-06-08 00:28:03 +01:00
|
|
|
<property name="allowEmptyConstructors" value="true" />
|
2021-10-06 18:28:28 +01:00
|
|
|
<property name="allowEmptyTypes" value="true" />
|
2021-11-21 11:19:02 +00:00
|
|
|
|
2019-06-09 09:07:31 +01:00
|
|
|
<property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAMBDA,LAND,LCURLY,LE,LITERAL_RETURN,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND" />
|
2019-06-08 00:28:03 +01:00
|
|
|
</module>
|
|
|
|
</module>
|
|
|
|
|
|
|
|
<module name="FileTabCharacter" />
|
|
|
|
<module name="NewlineAtEndOfFile" />
|
2019-10-16 09:22:38 +01:00
|
|
|
<module name="RegexpSingleline">
|
|
|
|
<property name="format" value="\s+$"/>
|
|
|
|
<property name="message" value="Trailing whitespace"/>
|
|
|
|
</module>
|
2019-06-08 00:28:03 +01:00
|
|
|
</module>
|