From de46f3ab0788091702a0c730d4366020d3e64ae8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jul 2017 15:02:45 +0900 Subject: [PATCH] Remove all unnecessary parenthesis where object initialisers are used Enforces at CI. --- osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs | 2 +- osu.Desktop.VisualTests/Tests/TestCaseResults.cs | 2 +- osu.Desktop/Overlays/VersionManager.cs | 2 +- osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs | 2 +- osu.Game/Graphics/Containers/SectionsContainer.cs | 2 +- osu.Game/Overlays/Direct/FilterControl.cs | 2 +- osu.Game/Overlays/Notifications/ProgressNotification.cs | 2 +- osu.Game/Overlays/Settings/SettingsItem.cs | 2 +- osu.Game/Overlays/Settings/SettingsSlider.cs | 2 +- osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs | 2 +- osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs | 2 +- osu.Game/Screens/Select/BeatmapDetails.cs | 2 +- osu.Game/Screens/Select/FilterControl.cs | 2 +- osu.sln.DotSettings | 4 ++-- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index 01d7d4ff01..909ee9b134 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -198,7 +198,7 @@ namespace osu.Desktop.VisualTests.Tests AutoSizeAxes = Axes.Both; Direction = FillDirection.Horizontal; Add(new OsuSpriteText { Text = header + @": ", TextSize = text_size }); - Add(valueText = new OsuSpriteText() { TextSize = text_size }); + Add(valueText = new OsuSpriteText { TextSize = text_size }); Margin = new MarginPadding(margin); } } diff --git a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs index 1cfc2fc664..775bfe0f03 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs @@ -46,7 +46,7 @@ namespace osu.Desktop.VisualTests.Tests MaxCombo = 123, Rank = ScoreRank.A, Date = DateTimeOffset.Now, - Statistics = new Dictionary() + Statistics = new Dictionary { { "300", 50 }, { "100", 20 }, diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 0a10a60dca..a8ab97ce37 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -186,7 +186,7 @@ namespace osu.Desktop.Overlays { private OsuGame game; - protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification() + protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification { Text = @"Update ready to install. Click to restart!", Activated = () => diff --git a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs index acf90931ac..e7035880dd 100644 --- a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs +++ b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs @@ -91,7 +91,7 @@ namespace osu.Game.Beatmaps.ControlPoints if (time < list[0].Time) return prePoint ?? new T(); - int index = list.BinarySearch(new T() { Time = time }); + int index = list.BinarySearch(new T { Time = time }); // Check if we've found an exact match (t == time) if (index >= 0) diff --git a/osu.Game/Graphics/Containers/SectionsContainer.cs b/osu.Game/Graphics/Containers/SectionsContainer.cs index 1d792f1b78..90cfa9046a 100644 --- a/osu.Game/Graphics/Containers/SectionsContainer.cs +++ b/osu.Game/Graphics/Containers/SectionsContainer.cs @@ -114,7 +114,7 @@ namespace osu.Game.Graphics.Containers public SectionsContainer() { - Add(ScrollContainer = new ScrollContainer() + Add(ScrollContainer = new ScrollContainer { RelativeSizeAxes = Axes.Both, Masking = false, diff --git a/osu.Game/Overlays/Direct/FilterControl.cs b/osu.Game/Overlays/Direct/FilterControl.cs index bb6055dc4f..e947895fc2 100644 --- a/osu.Game/Overlays/Direct/FilterControl.cs +++ b/osu.Game/Overlays/Direct/FilterControl.cs @@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Direct { DisplayStyleControl.Dropdown.AccentColour = colours.BlueDark; - Ruleset.BindTo(game?.Ruleset ?? new Bindable() { Value = rulesets.GetRuleset(0) }); + Ruleset.BindTo(game?.Ruleset ?? new Bindable { Value = rulesets.GetRuleset(0) }); foreach (var r in rulesets.AllRulesets) { modeButtons.Add(new RulesetToggleButton(Ruleset, r)); diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs index 437971337b..f0fa7e6da1 100644 --- a/osu.Game/Overlays/Notifications/ProgressNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs @@ -90,7 +90,7 @@ namespace osu.Game.Overlays.Notifications private ProgressNotificationState state; - protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification() + protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification { Activated = CompletionClickAction, Text = $"Task \"{Text}\" has completed!" diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index 14b67dd6df..f80fef4a99 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Settings if (text == null) { // construct lazily for cases where the label is not needed (may be provided by the Control). - Add(text = new OsuSpriteText() { Depth = 1 }); + Add(text = new OsuSpriteText { Depth = 1 }); } text.Text = value; diff --git a/osu.Game/Overlays/Settings/SettingsSlider.cs b/osu.Game/Overlays/Settings/SettingsSlider.cs index 522d242f2a..2881d02302 100644 --- a/osu.Game/Overlays/Settings/SettingsSlider.cs +++ b/osu.Game/Overlays/Settings/SettingsSlider.cs @@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Settings where T : struct, IEquatable where U : SliderBar, new() { - protected override Drawable CreateControl() => new U() + protected override Drawable CreateControl() => new U { Margin = new MarginPadding { Top = 5, Bottom = 5 }, RelativeSizeAxes = Axes.X diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index 7f69d3109c..ea958d05f9 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -16,7 +16,7 @@ namespace osu.Game.Screens.Play.ReplaySettings { Children = new Drawable[] { - new ReplaySliderBar() + new ReplaySliderBar { LabelText = "Playback speed", Bindable = config.GetBindable(OsuSetting.PlaybackSpeed) diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs b/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs index 4992c3a1e7..e80ec092d9 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs +++ b/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs @@ -13,7 +13,7 @@ namespace osu.Game.Screens.Play.ReplaySettings public class ReplaySliderBar : SettingsSlider where T : struct, IEquatable { - protected override Drawable CreateControl() => new Sliderbar() + protected override Drawable CreateControl() => new Sliderbar { Margin = new MarginPadding { Top = 5, Bottom = 5 }, RelativeSizeAxes = Axes.X diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 481637e2af..9ad932ff26 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -160,7 +160,7 @@ namespace osu.Game.Screens.Select Colour = Color4.Black, Alpha = 0.5f, }, - new FillFlowContainer() + new FillFlowContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 4cc357a01b..35fee9e32d 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -128,7 +128,7 @@ namespace osu.Game.Screens.Select // Bottom = 5 // }, //}, - sortTabs = new OsuTabControl() + sortTabs = new OsuTabControl { RelativeSizeAxes = Axes.X, Width = 0.5f, diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 70bfacd6ef..be78ad39f6 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -66,8 +66,8 @@ DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW - - True + WARNING + WARNING WARNING WARNING