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>

95
pom.xml
View File

@ -1,55 +1,54 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pw.kaboom</groupId>
<artifactId>CommandSpy</artifactId>
<version>master</version>
<modelVersion>4.0.0</modelVersion>
<groupId>pw.kaboom</groupId>
<artifactId>CommandSpy</artifactId>
<version>master</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.test.skip>true</maven.test.skip>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.test.skip>true</maven.test.skip>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
</repositories>
<repositories>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
</repositories>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>checkstyle</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<suppressionsLocation>
suppressions.xml
</suppressionsLocation>
<failOnViolation>true</failOnViolation>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>checkstyle</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<suppressionsLocation>suppressions.xml</suppressionsLocation>
<failOnViolation>true</failOnViolation>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

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="."/>
<suppress checks="Javadoc" files="."/>
</suppressions>