Skip to content

Commit 1dcb298

Browse files
committed
More linting fixes
1 parent 9514e81 commit 1dcb298

27 files changed

Lines changed: 42 additions & 79 deletions

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "gradle"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

bot/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM azul/zulu-openjdk-alpine:21 AS builder
1+
FROM azul/zulu-openjdk-alpine:25 AS builder
22

33
WORKDIR /skybot
44

@@ -11,7 +11,7 @@ ENV GIT_HASH=$git_sha
1111
COPY . .
1212
RUN ./gradlew --no-daemon :bot:build
1313

14-
FROM azul/zulu-openjdk-alpine:21-jre
14+
FROM azul/zulu-openjdk-alpine:25-jre
1515

1616
# add libstdc++ for playing back mp3's with lavaplayer
1717
# also add some fonts

bot/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ plugins {
3535
id("com.github.breadmoirai.github-release")
3636
}
3737

38-
val pmdVersion = "7.0.0-rc4"
38+
val pmdVersion = "7.21.0"
3939

40-
val numberVersion = "3.109.4"
40+
val numberVersion = "3.110.0"
4141

4242
project.group = "me.duncte123.skybot"
4343
project.version = "${numberVersion}_${getGitHash()}"

bot/linters/pmd.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<exclude name="CommentDefaultAccessModifier"/>
4747
<exclude name="UselessParentheses"/>
4848
<exclude name="LinguisticNaming"/>
49+
<exclude name="UseExplicitTypes"/>
4950
</rule>
5051

5152
<rule ref="category/java/codestyle.xml/LongVariable">
@@ -66,8 +67,9 @@
6667
<exclude name="ExcessiveImports"/>
6768
<exclude name="TooManyMethods"/>
6869
<exclude name="NcssCount"/>
69-
<exclude name="ExcessiveMethodLength"/>
70+
<!-- <exclude name="ExcessiveMethodLength"/>-->
7071
<exclude name="MutableStaticState"/>
72+
<exclude name="AvoidDeeplyNestedIfStmts"/>
7173
</rule>
7274

7375
<rule ref="category/java/design.xml/NPathComplexity">
@@ -110,6 +112,7 @@
110112
</rule>-->
111113

112114
<rule ref="category/java/errorprone.xml">
115+
<exclude name="AvoidCatchingGenericException"/>
113116
<exclude name="AvoidCatchingThrowable"/>
114117
<exclude name="AssignmentToNonFinalStatic"/>
115118
<exclude name="CallSuperFirst"/>
@@ -128,6 +131,7 @@
128131

129132
<rule ref="category/java/multithreading.xml">
130133
<exclude name="DoNotUseThreads"/>
134+
<exclude name="AvoidSynchronizedStatement"/>
131135
</rule>
132136

133137
<rule ref="category/java/performance.xml">

bot/src/main/java/me/duncte123/skybot/CommandManager.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
import me.duncte123.botcommons.messaging.MessageConfig;
2525
import me.duncte123.skybot.commands.admin.BlackListCommand;
2626
import me.duncte123.skybot.commands.admin.VcAutoRoleCommand;
27-
import me.duncte123.skybot.commands.animals.*;
27+
import me.duncte123.skybot.commands.animals.SealCommand;
2828
import me.duncte123.skybot.commands.essentials.*;
2929
import me.duncte123.skybot.commands.essentials.eval.EvalCommand;
3030
import me.duncte123.skybot.commands.funCmds.*;
31-
import me.duncte123.skybot.commands.funcmds.*;
31+
import me.duncte123.skybot.commands.funcmds.ExplosmCommand;
32+
import me.duncte123.skybot.commands.funcmds.LoadingBarCommand;
3233
import me.duncte123.skybot.commands.guild.GuildInfoCommand;
3334
import me.duncte123.skybot.commands.guild.GuildJoinsCommand;
3435
import me.duncte123.skybot.commands.guild.mod.*;
@@ -37,15 +38,12 @@
3738
import me.duncte123.skybot.commands.guild.owner.LockEmoteCommand;
3839
import me.duncte123.skybot.commands.guild.owner.UnlockEmoteCommand;
3940
import me.duncte123.skybot.commands.guild.owner.settings.*;
40-
import me.duncte123.skybot.commands.image.*;
41-
import me.duncte123.skybot.commands.image.filter.*;
4241
import me.duncte123.skybot.commands.mod.*;
4342
import me.duncte123.skybot.commands.music.*;
4443
import me.duncte123.skybot.commands.uncategorized.*;
4544
import me.duncte123.skybot.commands.utils.EmoteCommand;
4645
import me.duncte123.skybot.commands.utils.EnlargeCommand;
4746
import me.duncte123.skybot.commands.utils.RoleInfoCommand;
48-
import me.duncte123.skybot.commands.weeb.*;
4947
import me.duncte123.skybot.entities.jda.DunctebotGuild;
5048
import me.duncte123.skybot.objects.SlashSupport;
5149
import me.duncte123.skybot.objects.command.*;
@@ -80,8 +78,8 @@
8078
import java.util.stream.Collectors;
8179

8280
import static me.duncte123.botcommons.messaging.MessageUtils.sendMsg;
83-
import static me.duncte123.skybot.utils.ThreadUtils.runOnVirtual;
8481
import static me.duncte123.skybot.utils.AirUtils.setJDAContext;
82+
import static me.duncte123.skybot.utils.ThreadUtils.runOnVirtual;
8583
import static net.dv8tion.jda.api.requests.ErrorResponse.MISSING_ACCESS;
8684
import static net.dv8tion.jda.api.requests.ErrorResponse.UNKNOWN_CHANNEL;
8785

@@ -269,7 +267,7 @@ public CommandManager(Variables variables) {
269267
this.addCommand(new StatsCommand());
270268
this.addCommand(new StopCommand());
271269
this.addCommand(new SuggestCommand());
272-
this.addCommand(new TagCommand(variables));
270+
// this.addCommand(new TagCommand(variables));
273271
this.addCommand(new TempBanCommand());
274272
this.addCommand(new TempMuteCommand());
275273
// this.addCommand(new TestFilterCommand());
@@ -317,7 +315,7 @@ public Collection<ICommand<CommandContext>> getCommands() {
317315
public List<ICommand<CommandContext>> getCommands(CommandCategory category) {
318316
return this.commands.values()
319317
.stream()
320-
.filter((c) -> c.getCategory().equals(category))
318+
.filter((c) -> c.getCategory() == category)
321319
.collect(Collectors.toList());
322320
}
323321

bot/src/main/java/me/duncte123/skybot/EventManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public void unregister(@Nonnull Object listener) {
8080
}
8181

8282

83-
@SuppressWarnings("PMD.InvalidLogMessageFormat") // /shrug
8483
@Override
8584
public void handle(@Nonnull GenericEvent event) {
8685
final JDA.ShardInfo shardInfo = event.getJDA().getShardInfo();

bot/src/main/java/me/duncte123/skybot/Settings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
package me.duncte123.skybot;
2020

21-
@SuppressWarnings({"PMD.FieldNamingConventions", "PMD.ClassNamingConventions"})
21+
@SuppressWarnings({"PMD.FieldNamingConventions"})
2222
public class Settings {
2323
public static String PREFIX = "db!";
2424
public static boolean AUTO_REBOOT_SHARDS = true; // set to false if shards are rebooted when they shouldn't be

bot/src/main/java/me/duncte123/skybot/Variables.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public final class Variables {
6666
private final WeebApi weebApi;
6767
private final DunctebotConfig config;
6868
private AbstractDatabase database;
69-
@SuppressWarnings("PMD.UseConcurrentHashMap")
7069
private final DBMap<Long, GuildSetting> guildSettingsCache = new DBMap<>(ExpiringMap.builder()
7170
.expirationPolicy(ExpirationPolicy.ACCESSED)
7271
.expiration(12, TimeUnit.HOURS)

bot/src/main/java/me/duncte123/skybot/commands/essentials/TokenCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public void execute(@Nonnull CommandContext ctx) {
8080
sendMsg(ctx, String.format("Invalid token: (%s) %s", errorType, errorMessage));
8181
}
8282

83+
@SuppressWarnings("PMD.ReplaceJavaUtilCalendar") // will do in the future
8384
@Nullable
8485
private OffsetDateTime toTimeStamp(long input) {
8586
try {

bot/src/main/java/me/duncte123/skybot/commands/essentials/WolframAlphaCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
import static me.duncte123.skybot.utils.AirUtils.shortenUrl;
4242

43+
@SuppressWarnings("PMD.UnusedPrivateMethod")
4344
public class WolframAlphaCommand extends Command {
4445

4546
private WAEngine waEngine = null;

0 commit comments

Comments
 (0)