Skip to content

Commit

Permalink
Discard redundant throw away and switch remaining suggestions to hint…
Browse files Browse the repository at this point in the history
… or warning
  • Loading branch information
peppy committed Jun 24, 2022
1 parent 58b49a4 commit d567280
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 24 deletions.
4 changes: 4 additions & 0 deletions osu-framework.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MissingLinebreak/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MissingSpace/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MoreSpecificForeachVariableTypeAvailable/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MoveVariableDeclarationInsideLoopCondition/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleSpaces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleStatementsOnOneLine/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleTypeMembersOnOneLine/@EntryIndexedValue">WARNING</s:String>
Expand All @@ -137,6 +138,8 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PossibleInterfaceMemberAmbiguity/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PossibleMultipleEnumeration/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PrivateVariableCanBeMadeReadonly/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PropertyCanBeMadeInitOnly_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PropertyCanBeMadeInitOnly_002ELocal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PublicConstructorInAbstractClass/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantArgumentDefaultValue/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantArrayCreationExpression/@EntryIndexedValue">WARNING</s:String>
Expand All @@ -147,6 +150,7 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInAttributeList/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInEnumDeclaration/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInInitializer/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantDiscardDesignation/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantEmptyObjectCreationArgumentList/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantExplicitParamsArrayCreation/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantImmediateDelegateInvocation/@EntryIndexedValue">WARNING</s:String>
Expand Down
8 changes: 4 additions & 4 deletions osu.Framework.Tests/Visual/Input/TestSceneTouchInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,10 @@ protected override bool Handle(UIEvent e)

break;

case MouseDownEvent _:
case MouseMoveEvent _:
case DragEvent _:
case MouseUpEvent _:
case MouseDownEvent:
case MouseMoveEvent:
case DragEvent:
case MouseUpEvent:
if (HandleMouse?.Invoke((MouseEvent)e) != false)
{
MouseEvents.Enqueue((MouseEvent)e);
Expand Down
6 changes: 3 additions & 3 deletions osu.Framework/Audio/Track/TrackBass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ private int prepareStream(Stream data, bool quick)
{
switch (data)
{
case MemoryStream _:
case UnmanagedMemoryStream _:
case AsyncBufferStream _:
case MemoryStream:
case UnmanagedMemoryStream:
case AsyncBufferStream:
// Buffering memory stream is definitely unworthy.
dataStream = data;
break;
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Bindables/Bindable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public virtual void Parse(object input)
Value = t;
break;

case IBindable _:
case IBindable:
if (!(input is IBindable<T> bindable))
throw new ArgumentException($"Expected bindable of type {nameof(IBindable)}<{typeof(T)}>, got {input.GetType()}", nameof(input));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ protected virtual void AddMarkdownComponent(IMarkdownObject markdownObject, Fill
AddMarkdownComponent(single, container, level);
break;

case HtmlBlock _:
case HtmlBlock:
// HTML is not supported
break;

case LinkReferenceDefinitionGroup _:
case LinkReferenceDefinitionGroup:
// Link reference doesn't need to be displayed.
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void AddInlineText(ContainerInline container)
{
switch (literal.Parent)
{
case EmphasisInline _:
case EmphasisInline:
var parent = literal.Parent;

var emphases = new List<string>();
Expand Down Expand Up @@ -94,8 +94,8 @@ public void AddInlineText(ContainerInline container)
AddImage(linkInline);
break;

case HtmlInline _:
case HtmlEntityInline _:
case HtmlInline:
case HtmlEntityInline:
// Handled by the next literal
break;

Expand Down
4 changes: 2 additions & 2 deletions osu.Framework/Graphics/Containers/OverlayContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ protected override bool Handle(UIEvent e)
{
switch (e)
{
case ScrollEvent _:
case ScrollEvent:
if (BlockScrollInput && base.ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
return true;

break;

case MouseEvent _:
case MouseEvent:
if (BlockPositionalInput)
return true;

Expand Down
6 changes: 3 additions & 3 deletions osu.Framework/Input/InputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -890,9 +890,9 @@ private bool shouldLog(UIEvent eventType)
case KeyDownEvent k:
return !k.Repeat;

case DragEvent _:
case ScrollEvent _:
case MouseMoveEvent _:
case DragEvent:
case ScrollEvent:
case MouseMoveEvent:
return false;

default:
Expand Down
10 changes: 5 additions & 5 deletions osu.Framework/Input/PassThroughInputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ protected override bool Handle(UIEvent e)
new MidiKeyInput(midi.Key, midi.Velocity, midi.IsPressed(midi.Key)).Apply(CurrentState, this);
break;

case KeyboardEvent _:
case JoystickButtonEvent _:
case JoystickAxisMoveEvent _:
case TabletPenButtonEvent _:
case TabletAuxiliaryButtonEvent _:
case KeyboardEvent:
case JoystickButtonEvent:
case JoystickAxisMoveEvent:
case TabletPenButtonEvent:
case TabletAuxiliaryButtonEvent:
SyncInputState(e.CurrentState);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Input/UserInputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public override void HandleInputStateChange(InputStateChangeEvent inputStateChan

break;

case MouseScrollChangeEvent _:
case MouseScrollChangeEvent:
if (Host.Window?.CursorInWindow.Value == false)
return;

Expand Down

0 comments on commit d567280

Please sign in to comment.