Enable SA1137 and fix noncompliance (except in Cores)

"Elements should have the same indentation"
This commit is contained in:
YoshiRulz 2020-11-30 21:36:48 +10:00
parent 44fb9fa368
commit 928ea057d8
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
9 changed files with 11 additions and 15 deletions

View File

@ -376,7 +376,7 @@
<Rule Id="SA1136" Action="Hidden" /> <Rule Id="SA1136" Action="Hidden" />
<!-- Elements should have the same indentation --> <!-- Elements should have the same indentation -->
<Rule Id="SA1137" Action="Hidden" /> <Rule Id="SA1137" Action="Error" />
</Rules> </Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.OrderingRules"> <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.OrderingRules">

View File

@ -54,8 +54,7 @@
} }
State = RunState.Disabled; State = RunState.Disabled;
//if(NLua.Lua.WhichLua == "NLua") if (true /*NLua.Lua.WhichLua == "NLua"*/) Thread.GetTable("keepalives")[Thread] = null;
Thread.GetTable("keepalives")[Thread] = null;
Thread = null; Thread = null;
} }

View File

@ -387,8 +387,7 @@ namespace BizHawk.Client.EmuHawk
// and OSD goes on top of that // and OSD goes on top of that
// TODO - things break if this isn't present (the final presentation filter gets messed up when used with prescaling) // TODO - things break if this isn't present (the final presentation filter gets messed up when used with prescaling)
// so, always include it (we'll handle this flag in the callback to do no rendering) // so, always include it (we'll handle this flag in the callback to do no rendering)
//if (includeOSD) if (true /*includeOSD*/) chain.AddFilter(fOSD, "osd");
chain.AddFilter(fOSD, "osd");
return chain; return chain;
} }

View File

@ -16,8 +16,7 @@ namespace BizHawk.Client.EmuHawk
{ {
public Win32LuaLibraries() public Win32LuaLibraries()
{ {
// if (NLua.Lua.WhichLua == "NLua") if (true /*NLua.Lua.WhichLua == "NLua"*/) _lua["keepalives"] = _lua.NewTable();
_lua["keepalives"] = _lua.NewTable();
} }
public Win32LuaLibraries( public Win32LuaLibraries(
@ -205,7 +204,7 @@ namespace BizHawk.Client.EmuHawk
var content = File.ReadAllText(file); var content = File.ReadAllText(file);
var main = lua.LoadString(content, "main"); var main = lua.LoadString(content, "main");
lua.Push(main); // push main function on to stack for subsequent resuming lua.Push(main); // push main function on to stack for subsequent resuming
//if (NLua.Lua.WhichLua == "NLua") if (true /*NLua.Lua.WhichLua == "NLua"*/)
{ {
_lua.GetTable("keepalives")[lua] = 1; _lua.GetTable("keepalives")[lua] = 1;
//this not being run is the origin of a memory leak if you restart scripts too many times //this not being run is the origin of a memory leak if you restart scripts too many times
@ -223,8 +222,7 @@ namespace BizHawk.Client.EmuHawk
{ {
_currThread = _lua.NewThread(); _currThread = _lua.NewThread();
_currThread.DoString(command); _currThread.DoString(command);
//if (NLua.Lua.WhichLua == "NLua") if (true /*NLua.Lua.WhichLua == "NLua"*/) _lua.Pop();
_lua.Pop();
} }
public override void RunScheduledDisposes() => _lua.RunScheduledDisposes(); public override void RunScheduledDisposes() => _lua.RunScheduledDisposes();

View File

@ -5,7 +5,7 @@
<Import Project="../MainSlnCommon.props" /> <Import Project="../MainSlnCommon.props" />
<PropertyGroup> <PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>$(NoWarn);SA1205;SA1208;SA1400</NoWarn> <NoWarn>$(NoWarn);SA1137;SA1205;SA1208;SA1400</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> <PackageReference Include="Microsoft.CSharp" Version="4.7.0" />