Skip to content

Commit

Permalink
Enable selected rules for usage
Browse files Browse the repository at this point in the history
  • Loading branch information
huoyaoyuan committed Nov 28, 2024
1 parent 0a8ec4d commit fced254
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 16 deletions.
7 changes: 5 additions & 2 deletions .globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ dotnet_diagnostic.CA2101.severity = none
# CA2201: Do not raise reserved exception types
dotnet_diagnostic.CA2201.severity = warning

#Disable operator overloads requiring alternate named methods
dotnet_diagnostic.CA2225.severity = none
# CA2208: Instantiate argument exceptions correctly
dotnet_diagnostic.CA2208.severity = suggestion

# CA2242: Test for NaN correctly
dotnet_diagnostic.CA2242.severity = warning

# Banned APIs
dotnet_diagnostic.RS0030.severity = error
Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<AnalysisModeNaming>Default</AnalysisModeNaming>
<AnalysisModePerformance>Minimum</AnalysisModePerformance>
<AnalysisModeReliability>Recommended</AnalysisModeReliability>
<AnalysisModeSecurity>Default</AnalysisModeSecurity>
<AnalysisModeUsage>Default</AnalysisModeUsage>
</PropertyGroup>
<PropertyGroup Label="Documentation">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
20 changes: 10 additions & 10 deletions osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private Color4 getColourForLayout(int columnIndex, StageDefinition stage)

case 1: return colour_cyan;

default: throw new ArgumentOutOfRangeException();
default: throw new ArgumentOutOfRangeException(nameof(columnIndex));
}

case 3:
Expand All @@ -176,7 +176,7 @@ private Color4 getColourForLayout(int columnIndex, StageDefinition stage)

case 2: return colour_cyan;

default: throw new ArgumentOutOfRangeException();
default: throw new ArgumentOutOfRangeException(nameof(columnIndex));
}

case 4:
Expand All @@ -190,7 +190,7 @@ private Color4 getColourForLayout(int columnIndex, StageDefinition stage)

case 3: return colour_purple;

default: throw new ArgumentOutOfRangeException();
default: throw new ArgumentOutOfRangeException(nameof(columnIndex));
}

case 5:
Expand All @@ -206,7 +206,7 @@ private Color4 getColourForLayout(int columnIndex, StageDefinition stage)

case 4: return colour_cyan;

default: throw new ArgumentOutOfRangeException();
default: throw new ArgumentOutOfRangeException(nameof(columnIndex));
}

case 6:
Expand All @@ -224,7 +224,7 @@ private Color4 getColourForLayout(int columnIndex, StageDefinition stage)

case 5: return colour_pink;

default: throw new ArgumentOutOfRangeException();
default: throw new ArgumentOutOfRangeException(nameof(columnIndex));
}

case 7:
Expand All @@ -244,7 +244,7 @@ private Color4 getColourForLayout(int columnIndex, StageDefinition stage)

case 6: return colour_pink;

default: throw new ArgumentOutOfRangeException();
default: throw new ArgumentOutOfRangeException(nameof(columnIndex));
}

case 8:
Expand All @@ -266,7 +266,7 @@ private Color4 getColourForLayout(int columnIndex, StageDefinition stage)

case 7: return colour_purple;

default: throw new ArgumentOutOfRangeException();
default: throw new ArgumentOutOfRangeException(nameof(columnIndex));
}

case 9:
Expand All @@ -290,7 +290,7 @@ private Color4 getColourForLayout(int columnIndex, StageDefinition stage)

case 8: return colour_purple;

default: throw new ArgumentOutOfRangeException();
default: throw new ArgumentOutOfRangeException(nameof(columnIndex));
}

case 10:
Expand All @@ -316,7 +316,7 @@ private Color4 getColourForLayout(int columnIndex, StageDefinition stage)

case 9: return colour_purple;

default: throw new ArgumentOutOfRangeException();
default: throw new ArgumentOutOfRangeException(nameof(columnIndex));
}
}

Expand All @@ -339,7 +339,7 @@ private Color4 getColourForLayout(int columnIndex, StageDefinition stage)

case 5: return colour_green;

default: throw new ArgumentOutOfRangeException();
default: throw new ArgumentOutOfRangeException(nameof(columnIndex));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Online/Leaderboards/Leaderboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ private void setState(LeaderboardState state)
return null;

default:
throw new ArgumentOutOfRangeException();
throw new ArgumentOutOfRangeException(nameof(state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Online/OnlineViewContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule((
break;

default:
throw new ArgumentOutOfRangeException();
throw new ArgumentOutOfRangeException(nameof(state.NewValue));
}
});

Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Overlays/AccountCreationOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private void apiStateChanged(ValueChangedEvent<APIState> state)
break;

default:
throw new ArgumentOutOfRangeException();
throw new ArgumentOutOfRangeException(nameof(state.NewValue));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Overlays/Toolbar/ToolbarUserButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule((
break;

default:
throw new ArgumentOutOfRangeException();
throw new ArgumentOutOfRangeException(nameof(state.NewValue));
}
});
}
Expand Down

0 comments on commit fced254

Please sign in to comment.