Change method group inspection to warning to match osu!

Fixes warnings when using a local framework checkout.
This commit is contained in:
Dean Herbert
2023-05-15 21:40:32 +09:00
parent 034729d264
commit 8477724791
9 changed files with 19 additions and 22 deletions

View File

@@ -63,7 +63,7 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CollectionNeverQueried_002ELocal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CompareOfFloatsByEqualityOperator/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertClosureToMethodGroup/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertClosureToMethodGroup/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertConditionalTernaryExpressionToSwitchExpression/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertIfDoToWhile/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertIfStatementToConditionalTernaryExpression/@EntryIndexedValue">WARNING</s:String>

View File

@@ -35,7 +35,7 @@ namespace osu.Framework.Tests.Containers
return result;
});
AddStep("clear all children", () => Clear());
AddStep("clear all children", Clear);
AddStep("load async", () => LoadComponentsAsync(composite, AddRange));

View File

@@ -67,7 +67,7 @@ namespace osu.Framework.Tests.Exceptions
runGameWithLogic(g =>
{
g.Scheduler.Add(() => Task.Run(() => throw new InvalidOperationException()));
g.Scheduler.AddDelayed(() => collect(), 1, true);
g.Scheduler.AddDelayed(collect, 1, true);
if (loggedException != null)
throw loggedException;

View File

@@ -28,8 +28,8 @@ namespace osu.Framework.Tests.Visual.Containers
public void TestPositionalUpdates()
{
AddStep("Move cursor to centre", () => InputManager.MoveMouseTo(container.ScreenSpaceDrawQuad.Centre));
AddAssert("Cursor is centered", () => cursorCenteredInContainer());
AddAssert("Cursor at mouse position", () => cursorAtMouseScreenSpace());
AddAssert("Cursor is centered", cursorCenteredInContainer);
AddAssert("Cursor at mouse position", cursorAtMouseScreenSpace);
}
[Test]
@@ -37,11 +37,11 @@ namespace osu.Framework.Tests.Visual.Containers
{
AddStep("Hide cursor container", () => cursorContainer.Alpha = 0f);
AddStep("Move cursor to centre", () => InputManager.MoveMouseTo(Content.ScreenSpaceDrawQuad.Centre));
AddAssert("Cursor is centered", () => cursorCenteredInContainer());
AddAssert("Cursor at mouse position", () => cursorAtMouseScreenSpace());
AddAssert("Cursor is centered", cursorCenteredInContainer);
AddAssert("Cursor at mouse position", cursorAtMouseScreenSpace);
AddStep("Show cursor container", () => cursorContainer.Alpha = 1f);
AddAssert("Cursor is centered", () => cursorCenteredInContainer());
AddAssert("Cursor at mouse position", () => cursorAtMouseScreenSpace());
AddAssert("Cursor is centered", cursorCenteredInContainer);
AddAssert("Cursor at mouse position", cursorAtMouseScreenSpace);
}
[Test]
@@ -50,9 +50,9 @@ namespace osu.Framework.Tests.Visual.Containers
AddStep("Move cursor to centre", () => InputManager.MoveMouseTo(container.ScreenSpaceDrawQuad.Centre));
AddStep("Move container", () => container.Y += 50);
AddAssert("Cursor no longer centered", () => !cursorCenteredInContainer());
AddAssert("Cursor at mouse position", () => cursorAtMouseScreenSpace());
AddAssert("Cursor at mouse position", cursorAtMouseScreenSpace);
AddStep("Resize container", () => container.Size *= new Vector2(1.4f, 1));
AddAssert("Cursor at mouse position", () => cursorAtMouseScreenSpace());
AddAssert("Cursor at mouse position", cursorAtMouseScreenSpace);
}
/// <summary>
@@ -63,8 +63,8 @@ namespace osu.Framework.Tests.Visual.Containers
{
AddStep("Move cursor to centre", () => InputManager.MoveMouseTo(Content.ScreenSpaceDrawQuad.Centre));
AddStep("Recreate container with mouse already in place", createContent);
AddAssert("Cursor is centered", () => cursorCenteredInContainer());
AddAssert("Cursor at mouse position", () => cursorAtMouseScreenSpace());
AddAssert("Cursor is centered", cursorCenteredInContainer);
AddAssert("Cursor at mouse position", cursorAtMouseScreenSpace);
}
private bool cursorCenteredInContainer() =>

View File

@@ -25,10 +25,7 @@ namespace osu.Framework.Tests.Visual.Containers
private TestBox blendedBox;
[SetUp]
public void Setup() => Schedule(() =>
{
Clear();
});
public void Setup() => Schedule(Clear);
[TearDownSteps]
public void TearDownSteps()

View File

@@ -206,12 +206,12 @@ namespace osu.Framework.Tests.Visual.Drawables
AddStep("add box", () => Child = box = new AsyncPerformingBox(true));
AddAssert("not spun", () => box.Rotation == 0);
AddStep("toggle execution mode", () => toggleExecutionMode());
AddStep("toggle execution mode", toggleExecutionMode);
AddStep("trigger", () => box.ReleaseAsyncLoadCompleteLock());
AddUntilStep("has spun", () => box.Rotation == 180);
AddStep("revert execution mode", () => toggleExecutionMode());
AddStep("revert execution mode", toggleExecutionMode);
void toggleExecutionMode()
{

View File

@@ -76,7 +76,7 @@ namespace osu.Framework.Audio.Track
relativeFrequencyHandler = new BassRelativeFrequencyHandler
{
FrequencyChangedToZero = () => stopInternal(),
FrequencyChangedToZero = stopInternal,
FrequencyChangedFromZero = () =>
{
// Do not resume the track if a play wasn't requested at all or has been paused via Stop().

View File

@@ -204,7 +204,7 @@ namespace osu.Framework.Input.Bindings
{
// if the current key pressed was a modifier, only handle modifier-only bindings.
// lambda expression is used so that the delegate is cached (see: https://github.com/dotnet/roslyn/issues/5835)
newlyPressed = newlyPressed.Where(b => b.KeyCombination.Keys.All(key => KeyCombination.IsModifierKey(key)));
newlyPressed = newlyPressed.Where(b => b.KeyCombination.Keys.All(KeyCombination.IsModifierKey));
}
// we want to always handle bindings with more keys before bindings with less.

View File

@@ -124,7 +124,7 @@ namespace osu.Framework.Input.Handlers.Midi
// some devices may take some time to close, so this should be fire-and-forget.
// the internal implementations look to have their own (eventual) timeout logic.
Task.Factory.StartNew(() => device.CloseAsync(), TaskCreationOptions.LongRunning);
Task.Factory.StartNew(device.CloseAsync, TaskCreationOptions.LongRunning);
}
private void onMidiMessageReceived(object sender, MidiReceivedEventArgs e)