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" />
<!-- Elements should have the same indentation -->
<Rule Id="SA1137" Action="Hidden" />
<Rule Id="SA1137" Action="Error" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers.OrderingRules">

View File

@ -11,7 +11,7 @@ namespace BizHawk.Client.Common
{
private readonly HttpClient _client = new HttpClient();
private readonly Func<byte[]> _takeScreenshotCallback;
private readonly Func<byte[]> _takeScreenshotCallback;
public int DefaultTimeout { get; set; } = 500;

View File

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

View File

@ -71,7 +71,7 @@ namespace BizHawk.Client.Common
{
public IStringLog Clone()
{
var ret = new ListStringLog();
var ret = new ListStringLog();
ret.AddRange(this);
return ret;
}

View File

@ -387,8 +387,7 @@ namespace BizHawk.Client.EmuHawk
// 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)
// so, always include it (we'll handle this flag in the callback to do no rendering)
//if (includeOSD)
chain.AddFilter(fOSD, "osd");
if (true /*includeOSD*/) chain.AddFilter(fOSD, "osd");
return chain;
}

View File

@ -145,7 +145,7 @@ namespace BizHawk.Client.EmuHawk.CoreExtensions
case "uzem":
return SystemInfo.UzeBox;
case "PCFX":
return SystemInfo.Pcfx;
return SystemInfo.Pcfx;
}
}
}

View File

@ -16,8 +16,7 @@ namespace BizHawk.Client.EmuHawk
{
public Win32LuaLibraries()
{
// if (NLua.Lua.WhichLua == "NLua")
_lua["keepalives"] = _lua.NewTable();
if (true /*NLua.Lua.WhichLua == "NLua"*/) _lua["keepalives"] = _lua.NewTable();
}
public Win32LuaLibraries(
@ -205,7 +204,7 @@ namespace BizHawk.Client.EmuHawk
var content = File.ReadAllText(file);
var main = lua.LoadString(content, "main");
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;
//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.DoString(command);
//if (NLua.Lua.WhichLua == "NLua")
_lua.Pop();
if (true /*NLua.Lua.WhichLua == "NLua"*/) _lua.Pop();
}
public override void RunScheduledDisposes() => _lua.RunScheduledDisposes();

View File

@ -39,7 +39,7 @@ namespace BizHawk.Client.EmuHawk
{
if (AskSaveChanges())
{
var newProject = CurrentTasMovie.ConvertToSavestateAnchoredMovie(
var newProject = CurrentTasMovie.ConvertToSavestateAnchoredMovie(
Emulator.Frame, StatableEmulator.CloneSavestate());
MainForm.PauseEmulator();

View File

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