Disable resharper inspections on case-by-case basis

This commit is contained in:
smoogipoo
2017-11-20 18:55:48 +09:00
parent f0966a2e12
commit aac41d2de6
21 changed files with 46 additions and 16 deletions

View File

@ -307,6 +307,7 @@ namespace osu.Game.Beatmaps
context.ChangeTracker.AutoDetectChangesEnabled = false;
// re-fetch the beatmap set on the import context.
// ReSharper disable once AccessToModifiedClosure
beatmapSet = context.BeatmapSetInfo.Include(s => s.Files).ThenInclude(f => f.FileInfo).First(s => s.ID == beatmapSet.ID);
// create local stores so we can isolate and thread safely, and share a context/transaction.

View File

@ -33,6 +33,7 @@ namespace osu.Game.Graphics.Cursor
// don't start rotating until we're moved a minimum distance away from the mouse down location,
// else it can have an annoying effect.
// ReSharper disable once PossibleInvalidOperationException
startRotation |= Vector2Extensions.Distance(state.Mouse.Position, state.Mouse.PositionMouseDown.Value) > 30;
if (startRotation)

View File

@ -186,6 +186,7 @@ namespace osu.Game.IO.Legacy
Debug.Assert(formatter != null, "formatter != null");
// ReSharper disable once PossibleNullReferenceException
return formatter.Deserialize(stream);
}

View File

@ -96,6 +96,7 @@ namespace osu.Game.Online.API
// if not, let's try using our refresh token to request a new access token.
if (!string.IsNullOrEmpty(Token?.RefreshToken))
// ReSharper disable once PossibleNullReferenceException
AuthenticateWithRefresh(Token.RefreshToken);
return accessTokenValid;

View File

@ -19,6 +19,7 @@ namespace osu.Game.Online.API.Requests
this.type = type;
}
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
protected override string Target => $@"users/{userId}/beatmapsets/{type.ToString().Underscore()}?offset={offset}";
}

View File

@ -18,6 +18,7 @@ namespace osu.Game.Online.API.Requests
this.offset = offset;
}
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLower()}?offset={offset}";
}
@ -27,4 +28,4 @@ namespace osu.Game.Online.API.Requests
Firsts,
Recent
}
}
}

View File

@ -27,6 +27,7 @@ namespace osu.Game.Online.API.Requests
this.direction = direction;
}
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)rankStatus}&sort={sortCriteria.ToString().ToLower()}_{directionString}";
}
}

View File

@ -57,6 +57,7 @@ namespace osu.Game.Online.Chat
public virtual bool Equals(Message other) => Id == other?.Id;
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
public override int GetHashCode() => Id.GetHashCode();
}

View File

@ -207,6 +207,7 @@ namespace osu.Game.Overlays
{
Trace.Assert(state.Mouse.PositionMouseDown != null);
// ReSharper disable once PossibleInvalidOperationException
double targetChatHeight = startDragChatHeight - (state.Mouse.Position.Y - state.Mouse.PositionMouseDown.Value.Y) / Parent.DrawSize.Y;
// If the channel selection screen is shown, mind its minimum height
@ -380,6 +381,7 @@ namespace osu.Game.Overlays
{
if (channel == null) return;
// ReSharper disable once AccessToModifiedClosure
var existing = careChannels.Find(c => c.Id == channel.Id);
if (existing != null)

View File

@ -71,6 +71,7 @@ namespace osu.Game.Overlays
{
Trace.Assert(state.Mouse.PositionMouseDown != null, "state.Mouse.PositionMouseDown != null");
// ReSharper disable once PossibleInvalidOperationException
Vector2 change = state.Mouse.Position - state.Mouse.PositionMouseDown.Value;
// Diminish the drag distance as we go further to simulate "rubber band" feeling.

View File

@ -60,6 +60,7 @@ namespace osu.Game.Rulesets.Timing
DifficultyPoint = other.DifficultyPoint;
}
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
public int CompareTo(MultiplierControlPoint other) => StartTime.CompareTo(other?.StartTime);
}
}

View File

@ -157,6 +157,7 @@ namespace osu.Game.Rulesets.UI
WorkingBeatmap = workingBeatmap;
IsForCurrentRuleset = isForCurrentRuleset;
// ReSharper disable once PossibleNullReferenceException
Mods = workingBeatmap.Mods.Value;
RelativeSizeAxes = Axes.Both;

View File

@ -255,6 +255,7 @@ namespace osu.Game.Rulesets.UI
var sX = (SpeedAdjustmentContainer)x;
var sY = (SpeedAdjustmentContainer)y;
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
int result = sY.ControlPoint.StartTime.CompareTo(sX.ControlPoint.StartTime);
if (result != 0)
return result;

View File

@ -123,6 +123,7 @@ namespace osu.Game.Screens.Select.Leaderboards
Origin = Anchor.CentreLeft,
Font = @"Exo2.0-MediumItalic",
TextSize = 22,
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
Text = RankPosition.ToString(),
},
},

View File

@ -326,6 +326,7 @@ namespace osu.Game.Screens.Tournament
if (line.ToUpper().StartsWith("GROUP"))
continue;
// ReSharper disable once AccessToModifiedClosure
DrawingsTeam teamToAdd = allTeams.FirstOrDefault(t => t.FullName == line);
if (teamToAdd == null)

View File

@ -13,9 +13,9 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Threading;
using osu.Game.Screens.Tournament.Teams;
using OpenTK;
using OpenTK.Graphics;
using osu.Game.Screens.Tournament.Teams;
namespace osu.Game.Screens.Tournament
{
@ -118,16 +118,18 @@ namespace osu.Game.Screens.Tournament
if (!Children.Any())
break;
Drawable closest = null;
ScrollingTeam closest = null;
foreach (var c in Children)
{
if (!(c is ScrollingTeam))
var stc = c as ScrollingTeam;
if (stc == null)
continue;
if (closest == null)
{
closest = c;
closest = stc;
continue;
}
@ -135,14 +137,15 @@ namespace osu.Game.Screens.Tournament
float lastOffset = Math.Abs(closest.Position.X + closest.DrawWidth / 2f - DrawWidth / 2f);
if (o < lastOffset)
closest = c;
closest = stc;
}
Trace.Assert(closest != null, "closest != null");
// ReSharper disable once PossibleNullReferenceException
offset += DrawWidth / 2f - (closest.Position.X + closest.DrawWidth / 2f);
ScrollingTeam st = closest as ScrollingTeam;
ScrollingTeam st = closest;
availableTeams.RemoveAll(at => at == st.Team);

View File

@ -38,6 +38,7 @@ namespace osu.Game.Screens.Tournament.Teams
if (string.IsNullOrEmpty(line))
continue;
// ReSharper disable once PossibleNullReferenceException
string[] split = line.Split(':');
if (split.Length < 2)