Skip to content

Commit

Permalink
chore: Update checkstyle to validate Javadoc tags more
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 committed Feb 22, 2022
1 parent 7430512 commit 642a1fd
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
<!-- https://checkstyle.org/config_javadoc.html#JavadocContentLocation -->
<module name="JavadocContentLocation"/>

<!-- https://checkstyle.org/config_javadoc.html#JavadocMethod -->
<module name="JavadocMethod" />

<!-- https://checkstyle.org/config_javadoc.html#JavadocMissingWhitespaceAfterAsterisk -->
<module name="JavadocMissingWhitespaceAfterAsterisk"/>

Expand All @@ -136,6 +139,11 @@
<!-- https://checkstyle.org/config_javadoc.html#JavadocMissingWhitespaceAfterAsterisk -->
<module name="JavadocTagContinuationIndentation"/>

<!-- https://checkstyle.org/config_javadoc.html#JavadocType -->
<module name="JavadocType">
<property name="allowUnknownTags" value="true" /> <!-- @sinceMinecraft is not supported -->
</module>

<!-- https://checkstyle.org/config_blocks.html#LeftCurly -->
<module name="LeftCurly"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ public final class NamedTextColor implements TextColor {
*
* <p>This value is unitless and should only be used to compare with other text colours.</p>
*
* @param self the base colour
* @param other colour to compare to
* @return distance metric
*/
Expand Down
1 change: 1 addition & 0 deletions key/src/main/java/net/kyori/adventure/key/Key.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public interface Key extends Comparable<Key>, Examinable {
*
* <p>The {@link #value() value} is compared first, followed by the {@link #namespace() namespace}.</p>
*
* @return a comparator for keys
* @since 4.10.0
*/
static @NotNull Comparator<? super Key> comparator() {
Expand Down
13 changes: 12 additions & 1 deletion nbt/src/main/java/net/kyori/adventure/nbt/BinaryTagIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private BinaryTagIO() {
/**
* Returns {@link Reader}, used to read binary tags.
*
* <p>There is a maximum depth of {@code 512} nested tags allowed, but no limit for the amount of containe data.</p>
* <p>There is a maximum depth of {@code 512} nested tags allowed, but no limit for the amount of contained data.</p>
*
* @return binary tag reader
* @since 4.4.0
Expand All @@ -78,6 +78,7 @@ private BinaryTagIO() {
*
* <p>This reader will limit the number of bytes read to the approximate size limit indicated.</p>
*
* @param sizeLimitBytes the maximum (approximate) size of uncompressed data, must be greater than {@code 0}
* @return binary tag reader
* @since 4.4.0
*/
Expand Down Expand Up @@ -376,6 +377,7 @@ public interface Writer {
*
* <p>This is the equivalent of passing {@code Compression#NONE} as the second parameter to {@link #write(CompoundBinaryTag, Path, Compression)}.</p>
*
* @param tag the tag to write
* @param path the path
* @throws IOException if an exception was encountered while reading the tag
* @since 4.4.0
Expand All @@ -387,6 +389,7 @@ default void write(final @NotNull CompoundBinaryTag tag, final @NotNull Path pat
/**
* Writes a binary tag to {@code path} with a {@code compression} type.
*
* @param tag the tag to write
* @param path the path
* @param compression the compression type
* @throws IOException if an exception was encountered while reading the tag
Expand All @@ -399,6 +402,7 @@ default void write(final @NotNull CompoundBinaryTag tag, final @NotNull Path pat
*
* <p>This is the equivalent of passing {@link Compression#NONE} as the second parameter to {@link #write(CompoundBinaryTag, OutputStream, Compression)}.</p>
*
* @param tag the tag to write
* @param output the output stream
* @throws IOException if an exception was encountered while reading the tag
* @since 4.4.0
Expand All @@ -410,6 +414,7 @@ default void write(final @NotNull CompoundBinaryTag tag, final @NotNull OutputSt
/**
* Writes a binary tag to {@code output} with a {@code compression} type.
*
* @param tag the tag to write
* @param output the output stream
* @param compression the compression type
* @throws IOException if an exception was encountered while reading the tag
Expand All @@ -420,6 +425,7 @@ default void write(final @NotNull CompoundBinaryTag tag, final @NotNull OutputSt
/**
* Writes a binary tag to {@code output}.
*
* @param tag the tag to write
* @param output the output
* @throws IOException if an exception was encountered while reading the tag
* @since 4.4.0
Expand All @@ -431,6 +437,7 @@ default void write(final @NotNull CompoundBinaryTag tag, final @NotNull OutputSt
*
* <p>This is the equivalent of passing {@code Compression#NONE} as the second parameter to {@link #write(CompoundBinaryTag, Path, Compression)}.</p>
*
* @param tag the named tag entry to write
* @param path the path
* @throws IOException if an exception was encountered while reading the tag
* @since 4.4.0
Expand All @@ -442,6 +449,7 @@ default void writeNamed(final Map.@NotNull Entry<String, CompoundBinaryTag> tag,
/**
* Writes a binary tag, with a name, to {@code path} with a {@code compression} type.
*
* @param tag the named tag entry to write
* @param path the path
* @param compression the compression type
* @throws IOException if an exception was encountered while reading the tag
Expand All @@ -454,6 +462,7 @@ default void writeNamed(final Map.@NotNull Entry<String, CompoundBinaryTag> tag,
*
* <p>This is the equivalent of passing {@code Compression#NONE} as the second parameter to {@link #write(CompoundBinaryTag, OutputStream, Compression)}.</p>
*
* @param tag the named tag entry to write
* @param output the output stream
* @throws IOException if an exception was encountered while reading the tag
* @since 4.4.0
Expand All @@ -465,6 +474,7 @@ default void writeNamed(final Map.@NotNull Entry<String, CompoundBinaryTag> tag,
/**
* Writes a binary tag, with a name, to {@code output} with a {@code compression} type.
*
* @param tag the named tag entry to write
* @param output the output stream
* @param compression the compression type
* @throws IOException if an exception was encountered while reading the tag
Expand All @@ -475,6 +485,7 @@ default void writeNamed(final Map.@NotNull Entry<String, CompoundBinaryTag> tag,
/**
* Writes a binary tag, with a name, to {@code output}.
*
* @param tag the named tag entry to write
* @param output the output
* @throws IOException if an exception was encountered while reading the tag
* @since 4.4.0
Expand Down
3 changes: 2 additions & 1 deletion nbt/src/main/java/net/kyori/adventure/nbt/CharBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ public boolean hasMore(final int offset) {
/**
* Search for the provided token, and advance the reader index past the {@code until} character.
*
* @param until Case-insensitive token
* @param until case-insensitive token
* @return the string starting at the current position (inclusive) and going until the location of {@code until}, exclusive
* @throws StringTagParseException if {@code until} is not present in the remaining string
*/
public CharSequence takeUntil(char until) throws StringTagParseException {
until = Character.toLowerCase(until);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public interface CompoundBinaryTag extends BinaryTag, CompoundTagSetter<Compound
*
* <p>If {@code tags} is empty, {@link #empty()} will be returned.</p>
*
* @param tags the map of contents for the created tag
* @return a compound tag
* @since 4.4.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public interface ListBinaryTag extends ListTagSetter<ListBinaryTag, BinaryTag>,
*
* <p>The {@link #elementType() element type} of the returned list tag is determined from {@code tags}.</p>
*
* @param tags the list of contents for the created tag
* @return a list tag
* @throws IllegalArgumentException if {@code tags} has different tag types within
* @since 4.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public ListBinaryTag list() throws StringTagParseException {
/**
* Similar to a list tag in syntax, but returning a single array tag rather than a list of tags.
*
* @param elementType the indicator character for element type
* @return array-typed tag
* @throws StringTagParseException if the array was not properly terminated
*/
public BinaryTag array(char elementType) throws StringTagParseException {
this.buffer.expect(Tokens.ARRAY_BEGIN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public abstract class ValueNode extends ElementNode {
* @param parent the parent of this node
* @param token the token that created this node
* @param sourceMessage the source message
* @param value the value of this text node
* @since 4.10.0
*/
ValueNode(final @Nullable ElementNode parent, final @Nullable Token token, final @NotNull String sourceMessage, final @NotNull String value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ interface Builder extends Buildable.Builder<LegacyComponentSerializer> {
* when deserializing.
*
* @param pattern the url pattern
* @param style the style to apply to indicate that text is a link
* @return this builder
* @since 4.2.0
*/
Expand Down

0 comments on commit 642a1fd

Please sign in to comment.