1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Use readonly field when not reflected.

This commit is contained in:
Huo Yaoyuan 2019-11-12 18:30:25 +08:00
parent ca52d09e81
commit 205eda8566
2 changed files with 3 additions and 4 deletions

View File

@ -158,6 +158,7 @@ csharp_style_throw_expression = true:silent
csharp_style_conditional_delegate_call = true:suggestion csharp_style_conditional_delegate_call = true:suggestion
#Style - unused #Style - unused
dotnet_style_readonly_field = true:silent
dotnet_code_quality_unused_parameters = non_public:silent dotnet_code_quality_unused_parameters = non_public:silent
csharp_style_unused_value_expression_statement_preference = discard_variable:silent csharp_style_unused_value_expression_statement_preference = discard_variable:silent
csharp_style_unused_value_assignment_preference = discard_variable:suggestion csharp_style_unused_value_assignment_preference = discard_variable:suggestion
@ -175,8 +176,6 @@ dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
#Supressing roslyn built-in analyzers #Supressing roslyn built-in analyzers
# Suppress: EC112 # Suppress: EC112
#Field can be readonly
dotnet_diagnostic.IDE0044.severity = silent
#Private method is unused #Private method is unused
dotnet_diagnostic.IDE0051.severity = silent dotnet_diagnostic.IDE0051.severity = silent
#Private member is unused #Private member is unused

View File

@ -87,7 +87,7 @@ namespace osu.Game.Tests.NonVisual.Filtering
Assert.IsNull(filterCriteria.BPM.Max); Assert.IsNull(filterCriteria.BPM.Max);
} }
private static object[] lengthQueryExamples = private static readonly object[] length_query_examples =
{ {
new object[] { "6ms", TimeSpan.FromMilliseconds(6), TimeSpan.FromMilliseconds(1) }, new object[] { "6ms", TimeSpan.FromMilliseconds(6), TimeSpan.FromMilliseconds(1) },
new object[] { "23s", TimeSpan.FromSeconds(23), TimeSpan.FromSeconds(1) }, new object[] { "23s", TimeSpan.FromSeconds(23), TimeSpan.FromSeconds(1) },
@ -97,7 +97,7 @@ namespace osu.Game.Tests.NonVisual.Filtering
}; };
[Test] [Test]
[TestCaseSource(nameof(lengthQueryExamples))] [TestCaseSource(nameof(length_query_examples))]
public void TestApplyLengthQueries(string lengthQuery, TimeSpan expectedLength, TimeSpan scale) public void TestApplyLengthQueries(string lengthQuery, TimeSpan expectedLength, TimeSpan scale)
{ {
string query = $"length={lengthQuery} time"; string query = $"length={lengthQuery} time";