Add checkstyle validation for formatting, fix issues

This commit is contained in:
Kenzie Togami 2019-04-29 22:40:32 -07:00
parent 1e51bebc46
commit b1c042b196
No known key found for this signature in database
GPG Key ID: 5D200B325E157A81
6 changed files with 24 additions and 16 deletions

View File

@ -53,5 +53,13 @@
<!-- <module name="PackageName"/> Unlikely that we would miss this in a PR --> <!-- <module name="PackageName"/> Unlikely that we would miss this in a PR -->
<module name="ParameterName"/> <module name="ParameterName"/>
<!-- <module name="TypeName"/> Unlikely that we would miss this in a PR --> <!-- <module name="TypeName"/> Unlikely that we would miss this in a PR -->
<!-- Validate assignment operators -->
<module name="WhitespaceAround">
<property name="tokens" value="ASSIGN"/>
</module>
</module>
<!-- Validate that command annotations are formatted correctly -->
<module name="RegexpMultiline">
<property name="format" value="^( +)@(Arg|Switch|Command)\(.*?\n\1 {5,}"/>
</module> </module>
</module> </module>

View File

@ -208,7 +208,7 @@ public class MobSpawnerBlock extends BaseBlock {
this.spawnCount = spawnCountTag.getValue(); this.spawnCount = spawnCountTag.getValue();
} }
if (spawnRangeTag != null) { if (spawnRangeTag != null) {
this.spawnRange =spawnRangeTag.getValue(); this.spawnRange = spawnRangeTag.getValue();
} }
if (minSpawnDelayTag != null) { if (minSpawnDelayTag != null) {
this.minSpawnDelay = minSpawnDelayTag.getValue(); this.minSpawnDelay = minSpawnDelayTag.getValue();

View File

@ -19,8 +19,6 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import static com.sk89q.worldedit.command.util.Logging.LogMode.REGION;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
@ -59,6 +57,8 @@ import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.sk89q.worldedit.command.util.Logging.LogMode.REGION;
/** /**
* Implements biome-related commands such as "/biomelist". * Implements biome-related commands such as "/biomelist".
*/ */
@ -97,9 +97,9 @@ public class BiomeCommands {
) )
@CommandPermissions("worldedit.biome.info") @CommandPermissions("worldedit.biome.info")
public void biomeInfo(Player player, LocalSession session, public void biomeInfo(Player player, LocalSession session,
@Switch(name = 't', desc="Use the block you are looking at.") @Switch(name = 't', desc = "Use the block you are looking at.")
boolean useLineOfSight, boolean useLineOfSight,
@Switch(name = 'p', desc="Use the block you are currently in.") @Switch(name = 'p', desc = "Use the block you are currently in.")
boolean usePosition) throws WorldEditException { boolean usePosition) throws WorldEditException {
BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager() BiomeRegistry biomeRegistry = WorldEdit.getInstance().getPlatformManager()
.queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry(); .queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry();

View File

@ -223,9 +223,9 @@ public class GeneralCommands {
@Arg(desc = "Item query") @Arg(desc = "Item query")
String query, String query,
@Switch(name = 'b', desc = "Only search for blocks") @Switch(name = 'b', desc = "Only search for blocks")
boolean blocksOnly, boolean blocksOnly,
@Switch(name = 'i', desc = "Only search for items") @Switch(name = 'i', desc = "Only search for items")
boolean itemsOnly) throws WorldEditException { boolean itemsOnly) throws WorldEditException {
ItemType type = ItemTypes.get(query); ItemType type = ItemTypes.get(query);
if (type != null) { if (type != null) {

View File

@ -227,8 +227,8 @@ public class GenerationCommands {
} }
@Command( @Command(
name = "/hpyramid", name = "/hpyramid",
desc = "Generate a hollow pyramid" desc = "Generate a hollow pyramid"
) )
@CommandPermissions("worldedit.generation.pyramid") @CommandPermissions("worldedit.generation.pyramid")
@Logging(PLACEMENT) @Logging(PLACEMENT)

View File

@ -137,8 +137,8 @@ public class ToolCommands {
} }
@Command( @Command(
name = "deltree", name = "deltree",
desc = "Floating tree remover tool" desc = "Floating tree remover tool"
) )
@CommandPermissions("worldedit.tool.deltree") @CommandPermissions("worldedit.tool.deltree")
public void deltree(Player player, LocalSession session) throws WorldEditException { public void deltree(Player player, LocalSession session) throws WorldEditException {
@ -150,8 +150,8 @@ public class ToolCommands {
} }
@Command( @Command(
name = "farwand", name = "farwand",
desc = "Wand at a distance tool" desc = "Wand at a distance tool"
) )
@CommandPermissions("worldedit.tool.farwand") @CommandPermissions("worldedit.tool.farwand")
public void farwand(Player player, LocalSession session) throws WorldEditException { public void farwand(Player player, LocalSession session) throws WorldEditException {