diff --git a/ref/BlowFish/.editorconfig b/ref/BlowFish/.editorconfig index 2c9bc3f..b196d89 100644 --- a/ref/BlowFish/.editorconfig +++ b/ref/BlowFish/.editorconfig @@ -149,3 +149,6 @@ dotnet_diagnostic.S3903.severity = none # S1133: Deprecated code should be removed dotnet_diagnostic.S1133.severity = suggestion + +# S2325: Methods and properties that don't access instance data should be static +dotnet_diagnostic.S2325.severity = none diff --git a/ref/Common/.editorconfig b/ref/Common/.editorconfig index a4f327c..5ca6402 100644 --- a/ref/Common/.editorconfig +++ b/ref/Common/.editorconfig @@ -149,3 +149,6 @@ dotnet_diagnostic.CA1307.severity = warning # S3903: Move '%s' into a named namespace. dotnet_diagnostic.S3903.severity = none + +# S2325: Methods and properties that don't access instance data should be static +dotnet_diagnostic.S2325.severity = none diff --git a/ref/GitInformation/.editorconfig b/ref/GitInformation/.editorconfig index 66bcf28..835ae5e 100644 --- a/ref/GitInformation/.editorconfig +++ b/ref/GitInformation/.editorconfig @@ -152,3 +152,6 @@ dotnet_diagnostic.S3903.severity = none # S1133: Do not forget to remove this deprecated code someday. dotnet_diagnostic.S1133.severity = none + +# S2325: Methods and properties that don't access instance data should be static +dotnet_diagnostic.S2325.severity = none diff --git a/ref/MiniDump/.editorconfig b/ref/MiniDump/.editorconfig index 3a3c6ca..ca23f4e 100644 --- a/ref/MiniDump/.editorconfig +++ b/ref/MiniDump/.editorconfig @@ -152,3 +152,6 @@ dotnet_diagnostic.CA1303.severity = warning # S3903: Move '%s' into a named namespace. dotnet_diagnostic.S3903.severity = none + +# S2325: Methods and properties that don't access instance data should be static +dotnet_diagnostic.S2325.severity = none diff --git a/ref/PluginFramework/.editorconfig b/ref/PluginFramework/.editorconfig index 8104f41..0e78987 100644 --- a/ref/PluginFramework/.editorconfig +++ b/ref/PluginFramework/.editorconfig @@ -149,3 +149,6 @@ dotnet_diagnostic.S101.severity = none # S3903: Move '%s' into a named namespace. dotnet_diagnostic.S3903.severity = none + +# S2325: Methods and properties that don't access instance data should be static +dotnet_diagnostic.S2325.severity = none diff --git a/ref/PluginUpdateCheck/.editorconfig b/ref/PluginUpdateCheck/.editorconfig index ea1548d..cb1a753 100644 --- a/ref/PluginUpdateCheck/.editorconfig +++ b/ref/PluginUpdateCheck/.editorconfig @@ -161,3 +161,6 @@ dotnet_diagnostic.S3903.severity = none # IDE0251: Make member 'readonly' dotnet_diagnostic.IDE0251.severity = silent + +# S2325: Methods and properties that don't access instance data should be static +dotnet_diagnostic.S2325.severity = none diff --git a/src/UnluacNET/.editorconfig b/src/UnluacNET/.editorconfig index 9f81885..2e7b4d1 100644 --- a/src/UnluacNET/.editorconfig +++ b/src/UnluacNET/.editorconfig @@ -193,3 +193,6 @@ dotnet_diagnostic.IDE0072.severity = suggestion #Remove unnecessary usings/imports dotnet_diagnostic.IDE0005.severity = suggestion + +# S1244: Floating point numbers should not be tested for equality +dotnet_diagnostic.S1244.severity = none diff --git a/src/UnluacNET/Decompile/Decompiler.cs b/src/UnluacNET/Decompile/Decompiler.cs index 2698906..472f042 100644 --- a/src/UnluacNET/Decompile/Decompiler.cs +++ b/src/UnluacNET/Decompile/Decompiler.cs @@ -1352,9 +1352,9 @@ private Assignment ProcessOperation(Operation operation, int line, int nextLine, // TODO: Optimize code if (stmt != null) { - if (stmt is Assignment) + if (stmt is Assignment _assign) { - assign = stmt as Assignment; + assign = _assign; if (!assign.GetFirstValue().IsMultiple) { block.AddStatement(stmt); diff --git a/src/UnluacNET/LuaDecompileStream.cs b/src/UnluacNET/LuaDecompileStream.cs index 6986821..b130eaf 100644 --- a/src/UnluacNET/LuaDecompileStream.cs +++ b/src/UnluacNET/LuaDecompileStream.cs @@ -33,6 +33,7 @@ public LuaDecompileStream(Stream input) /// /// Controls if the stream keeps the input stream open when the stream is disposed. /// + [SuppressMessage("Style", "IDE0290:Use primary constructor", Justification = "Cannot be used for this class. This is a Roslyn Bug LOL.")] public LuaDecompileStream(Stream input, bool keepOpen) { this.BaseStream = input; diff --git a/src/UnluacNET/Parse/LFunctionType.cs b/src/UnluacNET/Parse/LFunctionType.cs index bfaf774..439f33d 100644 --- a/src/UnluacNET/Parse/LFunctionType.cs +++ b/src/UnluacNET/Parse/LFunctionType.cs @@ -33,7 +33,7 @@ public override LFunction Parse(Stream stream, BHeader header) s.VarArg); } - protected void ParseCode(Stream stream, BHeader header, LFunctionParseState s) + protected static void ParseCode(Stream stream, BHeader header, LFunctionParseState s) { if (header.Debug) { @@ -54,7 +54,7 @@ protected void ParseCode(Stream stream, BHeader header, LFunctionParseState s) } } - protected void ParseConstants(Stream stream, BHeader header, LFunctionParseState s) + protected static void ParseConstants(Stream stream, BHeader header, LFunctionParseState s) { if (header.Debug) { @@ -106,8 +106,8 @@ protected virtual void ParseMain(Stream stream, BHeader header, LFunctionParseSt s.LenParameter = stream.ReadByte(); s.VarArg = stream.ReadByte(); s.MaximumStackSize = stream.ReadByte(); - this.ParseCode(stream, header, s); - this.ParseConstants(stream, header, s); + ParseCode(stream, header, s); + ParseConstants(stream, header, s); this.ParseUpvalues(stream, header, s); this.ParseDebug(stream, header, s); } diff --git a/src/UnluacNET/Parse/LFunctionType52.cs b/src/UnluacNET/Parse/LFunctionType52.cs index d26e59b..b3cd2d5 100644 --- a/src/UnluacNET/Parse/LFunctionType52.cs +++ b/src/UnluacNET/Parse/LFunctionType52.cs @@ -20,8 +20,8 @@ protected override void ParseMain(Stream stream, BHeader header, LFunctionParseS s.LenParameter = stream.ReadByte(); s.VarArg = stream.ReadByte(); s.MaximumStackSize = stream.ReadByte(); - this.ParseCode(stream, header, s); - this.ParseConstants(stream, header, s); + ParseCode(stream, header, s); + ParseConstants(stream, header, s); this.ParseUpvalues(stream, header, s); this.ParseDebug(stream, header, s); }