diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 33054b5c8..2eb236eed 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -28,6 +28,7 @@ using SteamKit2; using SteamKit2.Internal; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Security.Cryptography; @@ -1494,7 +1495,7 @@ namespace ArchiSteamFarm { SteamClient.Connect(); } - // ReSharper disable once MemberCanBeMadeStatic.Local + [SuppressMessage("ReSharper", "MemberCanBeMadeStatic.Local")] private void OnFreeLicense(SteamApps.FreeLicenseCallback callback) { } private async void OnGuestPassList(SteamApps.GuestPassListCallback callback) { @@ -1763,7 +1764,7 @@ namespace ArchiSteamFarm { }); } - // ReSharper disable once MemberCanBeMadeStatic.Local + [SuppressMessage("ReSharper", "MemberCanBeMadeStatic.Local")] private void OnWebAPIUserNonce(SteamUser.WebAPIUserNonceCallback callback) { } private async void OnNotifications(ArchiHandler.NotificationsCallback callback) { diff --git a/ArchiSteamFarm/BotDatabase.cs b/ArchiSteamFarm/BotDatabase.cs index ec3a046e4..c26c1bcef 100644 --- a/ArchiSteamFarm/BotDatabase.cs +++ b/ArchiSteamFarm/BotDatabase.cs @@ -25,6 +25,7 @@ using Newtonsoft.Json; using SteamAuth; using System; +using System.Diagnostics.CodeAnalysis; using System.IO; namespace ArchiSteamFarm { @@ -101,7 +102,7 @@ namespace ArchiSteamFarm { } // This constructor is used only by deserializer - // ReSharper disable once UnusedMember.Local + [SuppressMessage("ReSharper", "UnusedMember.Local")] private BotDatabase() { } internal void Save() { diff --git a/ArchiSteamFarm/Debugging.cs b/ArchiSteamFarm/Debugging.cs index 42d28896c..2160105c7 100644 --- a/ArchiSteamFarm/Debugging.cs +++ b/ArchiSteamFarm/Debugging.cs @@ -24,15 +24,16 @@ using SteamKit2; using System; +using System.Diagnostics.CodeAnalysis; using System.IO; namespace ArchiSteamFarm { internal static class Debugging { #if DEBUG - // ReSharper disable once ConvertToConstant.Global + [SuppressMessage("ReSharper", "ConvertToConstant.Global")] internal static readonly bool IsDebugBuild = true; #else - // ReSharper disable once ConvertToConstant.Global + [SuppressMessage("ReSharper", "ConvertToConstant.Global")] internal static readonly bool IsDebugBuild = false; #endif diff --git a/ArchiSteamFarm/GlobalConfig.cs b/ArchiSteamFarm/GlobalConfig.cs index a1c7e34bd..20135ecb0 100644 --- a/ArchiSteamFarm/GlobalConfig.cs +++ b/ArchiSteamFarm/GlobalConfig.cs @@ -30,8 +30,7 @@ using System.IO; using System.Net.Sockets; namespace ArchiSteamFarm { - // ReSharper disable once ClassCannotBeInstantiated - // ReSharper disable once ClassNeverInstantiated.Global + [SuppressMessage("ReSharper", "ClassCannotBeInstantiated"), SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")] internal sealed class GlobalConfig { [SuppressMessage("ReSharper", "UnusedMember.Global")] internal enum EUpdateChannel : byte { diff --git a/ArchiSteamFarm/GlobalDatabase.cs b/ArchiSteamFarm/GlobalDatabase.cs index 44e640ca2..03e904ccd 100644 --- a/ArchiSteamFarm/GlobalDatabase.cs +++ b/ArchiSteamFarm/GlobalDatabase.cs @@ -24,6 +24,7 @@ using Newtonsoft.Json; using System; +using System.Diagnostics.CodeAnalysis; using System.IO; namespace ArchiSteamFarm { @@ -83,7 +84,7 @@ namespace ArchiSteamFarm { } // This constructor is used only by deserializer - // ReSharper disable once UnusedMember.Local + [SuppressMessage("ReSharper", "UnusedMember.Local")] private GlobalDatabase() { } private void Save() { diff --git a/ArchiSteamFarm/JSON/GitHub.cs b/ArchiSteamFarm/JSON/GitHub.cs index 11461a111..c7024d006 100644 --- a/ArchiSteamFarm/JSON/GitHub.cs +++ b/ArchiSteamFarm/JSON/GitHub.cs @@ -28,10 +28,8 @@ using Newtonsoft.Json; namespace ArchiSteamFarm.JSON { internal static class GitHub { - // ReSharper disable once ClassNeverInstantiated.Global - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Local")] + [SuppressMessage("ReSharper", "ClassNeverInstantiated.Global"), SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Local")] internal sealed class ReleaseResponse { - // ReSharper disable once ClassNeverInstantiated.Global internal sealed class Asset { [JsonProperty(PropertyName = "name", Required = Required.Always)] internal string Name { get; private set; } diff --git a/ArchiSteamFarm/JSON/Steam.cs b/ArchiSteamFarm/JSON/Steam.cs index 01c6413f1..513bffee3 100644 --- a/ArchiSteamFarm/JSON/Steam.cs +++ b/ArchiSteamFarm/JSON/Steam.cs @@ -50,8 +50,7 @@ namespace ArchiSteamFarm.JSON { internal uint AppID { get; set; } - // ReSharper disable once UnusedMember.Local - [JsonProperty(PropertyName = "appid", Required = Required.DisallowNull)] + [JsonProperty(PropertyName = "appid", Required = Required.DisallowNull), SuppressMessage("ReSharper", "UnusedMember.Local")] private string AppIDString { get { return AppID.ToString(); @@ -73,8 +72,7 @@ namespace ArchiSteamFarm.JSON { internal ulong ContextID { get; set; } - // ReSharper disable once UnusedMember.Local - [JsonProperty(PropertyName = "contextid", Required = Required.DisallowNull)] + [JsonProperty(PropertyName = "contextid", Required = Required.DisallowNull), SuppressMessage("ReSharper", "UnusedMember.Local")] private string ContextIDString { get { return ContextID.ToString(); @@ -116,8 +114,7 @@ namespace ArchiSteamFarm.JSON { } } - // ReSharper disable once UnusedMember.Local - [JsonProperty(PropertyName = "id", Required = Required.DisallowNull)] + [JsonProperty(PropertyName = "id", Required = Required.DisallowNull), SuppressMessage("ReSharper", "UnusedMember.Local")] private string ID { get { return AssetIDString; } set { AssetIDString = value; } @@ -125,8 +122,7 @@ namespace ArchiSteamFarm.JSON { internal ulong ClassID { get; set; } - // ReSharper disable once UnusedMember.Local - [JsonProperty(PropertyName = "classid", Required = Required.DisallowNull)] + [JsonProperty(PropertyName = "classid", Required = Required.DisallowNull), SuppressMessage("ReSharper", "UnusedMember.Local")] private string ClassIDString { get { return ClassID.ToString(); @@ -148,8 +144,7 @@ namespace ArchiSteamFarm.JSON { internal ulong InstanceID { get; set; } - // ReSharper disable once UnusedMember.Local - [JsonProperty(PropertyName = "instanceid", Required = Required.DisallowNull)] + [JsonProperty(PropertyName = "instanceid", Required = Required.DisallowNull), SuppressMessage("ReSharper", "UnusedMember.Local")] private string InstanceIDString { get { return InstanceID.ToString(); @@ -171,8 +166,7 @@ namespace ArchiSteamFarm.JSON { internal uint Amount { get; set; } - // ReSharper disable once UnusedMember.Local - [JsonProperty(PropertyName = "amount", Required = Required.Always)] + [JsonProperty(PropertyName = "amount", Required = Required.Always), SuppressMessage("ReSharper", "UnusedMember.Local")] private string AmountString { get { return Amount.ToString(); @@ -215,8 +209,7 @@ namespace ArchiSteamFarm.JSON { internal ulong TradeOfferID { get; set; } - // ReSharper disable once UnusedMember.Local - [JsonProperty(PropertyName = "tradeofferid", Required = Required.Always)] + [JsonProperty(PropertyName = "tradeofferid", Required = Required.Always), SuppressMessage("ReSharper", "UnusedMember.Local")] private string TradeOfferIDString { get { return TradeOfferID.ToString(); diff --git a/ArchiSteamFarm/Logging.cs b/ArchiSteamFarm/Logging.cs index 4ea10de6d..e94e05a9d 100644 --- a/ArchiSteamFarm/Logging.cs +++ b/ArchiSteamFarm/Logging.cs @@ -24,6 +24,7 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.CompilerServices; @@ -104,17 +105,16 @@ namespace ArchiSteamFarm { Log("[*] INFO: " + previousMethodName + "() <" + botName + "> " + message); } + [SuppressMessage("ReSharper", "ExplicitCallerInfoArgument")] internal static void LogNullError(string nullObjectName, string botName = "Main", [CallerMemberName] string previousMethodName = null) { if (string.IsNullOrEmpty(nullObjectName)) { return; } - // ReSharper disable once ExplicitCallerInfoArgument LogGenericError(nullObjectName + " is null!", botName, previousMethodName); } - // ReSharper disable once UnusedMember.Global - [Conditional("DEBUG")] + [Conditional("DEBUG"), SuppressMessage("ReSharper", "UnusedMember.Global")] internal static void LogGenericDebug(string message, string botName = "Main", [CallerMemberName] string previousMethodName = null) { if (string.IsNullOrEmpty(message)) { return; diff --git a/ArchiSteamFarm/Utilities.cs b/ArchiSteamFarm/Utilities.cs index a783b550d..44d575238 100644 --- a/ArchiSteamFarm/Utilities.cs +++ b/ArchiSteamFarm/Utilities.cs @@ -24,13 +24,14 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Net; using System.Threading.Tasks; namespace ArchiSteamFarm { internal static class Utilities { - // ReSharper disable once UnusedParameter.Global + [SuppressMessage("ReSharper", "UnusedParameter.Global")] internal static void Forget(this Task task) { } internal static Task ForEachAsync(this IEnumerable sequence, Func action) => action == null ? Task.FromResult(true) : Task.WhenAll(sequence.Select(action)); diff --git a/ConfigGenerator/BotConfig.cs b/ConfigGenerator/BotConfig.cs index 73b0f43a1..8b903e002 100644 --- a/ConfigGenerator/BotConfig.cs +++ b/ConfigGenerator/BotConfig.cs @@ -130,8 +130,7 @@ namespace ConfigGenerator { return botConfig; } - // This constructor is used only by deserializer - // ReSharper disable once UnusedMember.Local + [SuppressMessage("ReSharper", "UnusedMember.Local")] private BotConfig() { } private BotConfig(string filePath) : base(filePath) { diff --git a/ConfigGenerator/Debugging.cs b/ConfigGenerator/Debugging.cs index f30883203..bb56ec613 100644 --- a/ConfigGenerator/Debugging.cs +++ b/ConfigGenerator/Debugging.cs @@ -22,13 +22,15 @@ */ +using System.Diagnostics.CodeAnalysis; + namespace ConfigGenerator { internal static class Debugging { #if DEBUG - // ReSharper disable once ConvertToConstant.Global + [SuppressMessage("ReSharper", "ConvertToConstant.Global")] internal static readonly bool IsDebugBuild = true; #else - // ReSharper disable once ConvertToConstant.Global + [SuppressMessage("ReSharper", "ConvertToConstant.Global")] internal static readonly bool IsDebugBuild = false; #endif } diff --git a/ConfigGenerator/GlobalConfig.cs b/ConfigGenerator/GlobalConfig.cs index a14962c32..582684ba5 100644 --- a/ConfigGenerator/GlobalConfig.cs +++ b/ConfigGenerator/GlobalConfig.cs @@ -173,7 +173,7 @@ namespace ConfigGenerator { return globalConfig; } - // ReSharper disable once UnusedMember.Local + [SuppressMessage("ReSharper", "UnusedMember.Local")] private GlobalConfig() { } private GlobalConfig(string filePath) : base(filePath) { diff --git a/ConfigGenerator/Logging.cs b/ConfigGenerator/Logging.cs index d602c5505..ff743a9af 100644 --- a/ConfigGenerator/Logging.cs +++ b/ConfigGenerator/Logging.cs @@ -37,7 +37,7 @@ namespace ConfigGenerator { MessageBox.Show(message, Resources.Information, MessageBoxButtons.OK, MessageBoxIcon.Information); } - internal static void LogGenericError(string message, [CallerMemberName] string previousMethodName = "") { + internal static void LogGenericError(string message, [CallerMemberName] string previousMethodName = null) { if (string.IsNullOrEmpty(message)) { return; } @@ -45,7 +45,7 @@ namespace ConfigGenerator { MessageBox.Show(previousMethodName + @"() " + message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); } - internal static void LogGenericException(Exception exception, [CallerMemberName] string previousMethodName = "") { + internal static void LogGenericException(Exception exception, [CallerMemberName] string previousMethodName = null) { while (true) { if (exception == null) { return; @@ -62,7 +62,7 @@ namespace ConfigGenerator { } } - internal static void LogGenericWarning(string message, [CallerMemberName] string previousMethodName = "") { + internal static void LogGenericWarning(string message, [CallerMemberName] string previousMethodName = null) { if (string.IsNullOrEmpty(message)) { return; }