Enforce expression body for typical simple ones.

This commit is contained in:
Huo Yaoyuan 2019-11-12 18:26:42 +08:00
parent 8a1b70513c
commit ca52d09e81
4 changed files with 27 additions and 33 deletions

View File

@ -132,12 +132,13 @@ csharp_preferred_modifier_order = public,private,protected,internal,new,abstract
# Skipped because roslyn cannot separate +-*/ with << >> # Skipped because roslyn cannot separate +-*/ with << >>
#Style - expression bodies #Style - expression bodies
csharp_style_expression_bodied_accessors = true:silent csharp_style_expression_bodied_accessors = true:warning
csharp_style_expression_bodied_constructors = false:none csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_indexers = true:silent csharp_style_expression_bodied_indexers = true:warning
csharp_style_expression_bodied_methods = true:silent csharp_style_expression_bodied_methods = true:silent
csharp_style_expression_bodied_operators = true:silent csharp_style_expression_bodied_operators = true:warning
csharp_style_expression_bodied_properties = true:silent csharp_style_expression_bodied_properties = true:warning
csharp_style_expression_bodied_local_functions = true:silent
#Style - expression preferences #Style - expression preferences
dotnet_style_object_initializer = true:warning dotnet_style_object_initializer = true:warning
@ -166,7 +167,6 @@ csharp_style_inlined_variable_declaration = true:warning
csharp_style_deconstructed_variable_declaration = true:warning csharp_style_deconstructed_variable_declaration = true:warning
#Style - other C# 7.x features #Style - other C# 7.x features
csharp_style_expression_bodied_local_functions = true:silent
dotnet_style_prefer_inferred_tuple_names = true:warning dotnet_style_prefer_inferred_tuple_names = true:warning
csharp_prefer_simple_default_expression = true:warning csharp_prefer_simple_default_expression = true:warning
csharp_style_pattern_local_over_anonymous_function = true:silent csharp_style_pattern_local_over_anonymous_function = true:silent

View File

@ -50,9 +50,7 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"user_votes")] [JsonProperty(@"user_votes")]
private List<long> userVotes private List<long> userVotes
{ {
set set => value.ForEach(v =>
{
value.ForEach(v =>
{ {
Comments.ForEach(c => Comments.ForEach(c =>
{ {
@ -61,7 +59,6 @@ namespace osu.Game.Online.API.Requests.Responses
}); });
}); });
} }
}
private List<User> users; private List<User> users;

View File

@ -48,9 +48,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
protected APILegacyScores Scores protected APILegacyScores Scores
{ {
set set => Schedule(() =>
{
Schedule(() =>
{ {
topScoresContainer.Clear(); topScoresContainer.Clear();
@ -73,7 +71,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
topScoresContainer.Add(new DrawableTopScore(userScore.Score, userScore.Position)); topScoresContainer.Add(new DrawableTopScore(userScore.Score, userScore.Position));
}); });
} }
}
public ScoresContainer() public ScoresContainer()
{ {

View File

@ -129,7 +129,7 @@ namespace osu.Game.Users
[JsonProperty] [JsonProperty]
private string[] playstyle private string[] playstyle
{ {
set { PlayStyles = value?.Select(str => Enum.Parse(typeof(PlayStyle), str, true)).Cast<PlayStyle>().ToArray(); } set => PlayStyles = value?.Select(str => Enum.Parse(typeof(PlayStyle), str, true)).Cast<PlayStyle>().ToArray();
} }
public PlayStyle[] PlayStyles; public PlayStyle[] PlayStyles;