Set maximum line length to 100 characters

This commit is contained in:
kaboom 2022-05-20 05:15:47 +03:00
parent 7762bd56f5
commit 2c43271355
4 changed files with 66 additions and 56 deletions

10
checkstyle.xml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="LineLength">
<property name="max" value="100"/>
</module>
</module>

View File

@ -41,9 +41,8 @@
<goal>check</goal>
</goals>
<configuration>
<suppressionsLocation>
suppressions.xml
</suppressionsLocation>
<configLocation>checkstyle.xml</configLocation>
<suppressionsLocation>suppressions.xml</suppressionsLocation>
<failOnViolation>true</failOnViolation>
</configuration>
</execution>

View File

@ -41,7 +41,8 @@ public final class Main extends JavaPlugin implements CommandExecutor, Listener
}
@Override
public boolean onCommand(final CommandSender sender, final Command cmd, final String label, final String[] args) {
public boolean onCommand(final CommandSender sender, final Command cmd, final String label,
final String[] args) {
if (sender instanceof ConsoleCommandSender) {
sender.sendMessage("Command has to be run by a player");
return true;
@ -72,7 +73,8 @@ public final class Main extends JavaPlugin implements CommandExecutor, Listener
}
Set<String> uuids = config.getKeys(false);
ChatColor color = (uuids.contains(event.getPlayer().getUniqueId().toString())) ? ChatColor.YELLOW : ChatColor.AQUA;
ChatColor color = (uuids.contains(event.getPlayer().getUniqueId().toString()))
? ChatColor.YELLOW : ChatColor.AQUA;
for (String uuidString : uuids) {
UUID uuid = UUID.fromString(uuidString);
@ -91,7 +93,8 @@ public final class Main extends JavaPlugin implements CommandExecutor, Listener
@EventHandler
void onSignChange(final SignChangeEvent event) {
Set<String> uuids = config.getKeys(false);
ChatColor color = (uuids.contains(event.getPlayer().getUniqueId().toString())) ? ChatColor.YELLOW : ChatColor.AQUA;
ChatColor color = (uuids.contains(event.getPlayer().getUniqueId().toString()))
? ChatColor.YELLOW : ChatColor.AQUA;
for (String uuidString : uuids) {
UUID uuid = UUID.fromString(uuidString);

View File

@ -1,10 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.0//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
<suppress checks="Javadoc" files="."/>
<suppress checks="LineLength" files="."/>
</suppressions>