Skip to content

Commit

Permalink
[Bot] Resolve CA warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Pythonic-Rainbow committed Mar 14, 2024
1 parent 20c3889 commit fb2bfa6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions Bot/Clash/Coc.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Diagnostics.CodeAnalysis;
using ClashOfClans;
using ClashOfClans.Core;
using ClashOfClans.Models;
Expand All @@ -10,10 +9,10 @@ namespace Hyperstellar.Clash;

internal static class Coc
{
private class RaidAttackerComparer : IEqualityComparer<ClanCapitalRaidSeasonAttacker>
private sealed class RaidAttackerComparer : IEqualityComparer<ClanCapitalRaidSeasonAttacker>
{
public bool Equals(ClanCapitalRaidSeasonAttacker? x, ClanCapitalRaidSeasonAttacker? y) => x!.Tag == y!.Tag;
public int GetHashCode([DisallowNull] ClanCapitalRaidSeasonAttacker obj) => obj.Tag.GetHashCode();
public int GetHashCode(ClanCapitalRaidSeasonAttacker obj) => obj.Tag.GetHashCode();
}

private const string ClanId = "#2QU2UCJJC"; // 2G8LP8PVV
Expand Down Expand Up @@ -47,7 +46,7 @@ private static void CheckMembersJoined(ClanUtil clan)
foreach (ClanMember m in clan._joiningMembers.Values)
{
Main main = new(m.Tag);
EventMemberJoined!(m, main);
EventMemberJoined(m, main);
main.Insert();
}
}
Expand Down Expand Up @@ -80,7 +79,7 @@ private static void CheckMembersLeft(ClanUtil clan)
}
// This is before Db.DelMem below so that we can remap Donation to new mainId
// ^ No longer true because the remap is done ABOVE now but I'll still leave this comment
EventMemberLeft!(member, altId);
EventMemberLeft(member, altId);
}

string[] members = [.. clan._leavingMembers.Keys];
Expand Down Expand Up @@ -258,7 +257,7 @@ internal static async Task<ClanCapitalRaidSeason> GetRaidSeasonAsync()

internal static async Task InitAsync()
{
static async Task InitClanAsync() { Clan = ClanUtil.FromInit(await GetClanAsync()); }
static async Task InitClanAsync() => Clan = ClanUtil.FromInit(await GetClanAsync());

Check notice on line 260 in Bot/Clash/Coc.cs

View workflow job for this annotation

GitHub Actions / inspect

"[MoveLocalFunctionAfterJumpStatement] Put local function 'InitClanAsync' after 'return'" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Clash/Coc.cs(260,8981)
static async Task InitRaidAsync()

Check notice on line 261 in Bot/Clash/Coc.cs

View workflow job for this annotation

GitHub Actions / inspect

"[MoveLocalFunctionAfterJumpStatement] Put local function 'InitRaidAsync' after 'return'" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Clash/Coc.cs(261,9074)
{
ClanCapitalRaidSeason season = await GetRaidSeasonAsync();
Expand Down
2 changes: 1 addition & 1 deletion Bot/Clash/Violator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Hyperstellar.Clash;

internal class Violator(string id)
internal sealed class Violator(string id)
{
internal readonly string _id = id;
internal uint? _donated;
Expand Down

0 comments on commit fb2bfa6

Please sign in to comment.