Skip to content

Commit

Permalink
moooore rules
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianmakila committed Sep 27, 2024
1 parent 4eca9de commit 76000b2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ group = rootProject.group
version = rootProject.version
description = rootProject.description

checkstyle {
toolVersion = "10.18.1"
}


java.toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package fi.fabianadrian.webhooklogger.common.config;

import org.slf4j.Logger;
import space.arim.dazzleconf.error.InvalidConfigException;
import space.arim.dazzleconf.helper.ConfigurationHelper;

import java.io.IOException;
import java.nio.file.Path;

public final class ConfigManager {
Expand Down Expand Up @@ -41,15 +43,15 @@ public boolean reload() {
boolean success = true;
try {
this.mainConfigData = this.mainConfigHelper.reloadConfigData();
} catch (Exception e) {
} catch (IOException | InvalidConfigException e) {
this.logger.error("Could not load config.yml, falling back to default configuration", e);
this.mainConfigData = this.mainConfigHelper.getFactory().loadDefaults();
success = false;
}

try {
this.eventsConfigData = this.eventsConfigHelper.reloadConfigData();
} catch (Exception e) {
} catch (IOException | InvalidConfigException e) {
this.logger.error("Could not load events.yml, falling back to default configuration", e);
this.eventsConfigData = this.eventsConfigHelper.getFactory().loadDefaults();
success = false;
Expand Down
13 changes: 13 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,24 @@
<module name="InterfaceIsType"/>
<module name="MutableException"/>
<module name="OneTopLevelClass"/>
<module name="SealedShouldHavePermitsList"/>
<module name="ThrowsCount"/>
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true"/>
</module>

<!-- Coding -->
<module name="AvoidDoubleBraceInitialization"/>
<module name="AvoidNoArgumentSuperConstructorCall"/>
<module name="ConstructorsDeclarationGrouping"/>
<module name="CovariantEquals"/>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/>
<module name="ExplicitInitialization"/>
<module name="FallThrough"/>
<module name="IllegalCatch"/>

<module name="RegexpSinglelineJava">
<property name="format" value="^\t* "/>
<property name="message" value="Indent must use tab characters"/>
Expand Down

0 comments on commit 76000b2

Please sign in to comment.