Skip to content

Conversation

@bernardnormier
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR enables AnalysisMode=all in C# and updates several files to comply with stricter analysis requirements. The changes include:

  • Changing GreeterService from internal to public in two separate locations.
  • Updating Program.cs to use CultureInfo.CurrentCulture when formatting the timestamp.
  • Replacing manual null checks with ArgumentNullException.ThrowIfNull in two SimpleWakeUpService.cs files for a more modern and concise approach.

Reviewed Changes

File Description
csharp/IceBox/Greeter/Service/GreeterService.cs Changed accessibility from internal to public
csharp/IceGrid/IceBox/Service/GreeterService.cs Changed accessibility from internal to public
csharp/IceStorm/Weather/Sensor/Program.cs Introduced CultureInfo usage for timestamp formatting
csharp/Ice/Callback/Server/SimpleWakeUpService.cs Replaced null check with ArgumentNullException.ThrowIfNull
csharp/Glacier2/Callback/Server/SimpleWakeUpService.cs Replaced null check with ArgumentNullException.ThrowIfNull

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

dotnet_code_quality_unused_parameters = all:suggestion

# Diagnostic preferences
dotnet_diagnostic.CA5394.severity = none # Do not use insecure randomness
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, can't use the pseudo-random generator System.Random.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead we should be using RandomNumberGenerator.GetInt32 like we do in IceRPC.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix in a follow-up PR.

<ImplicitUsings>true</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- <AnalysisMode>All</AnalysisMode> -->
<ImplicitUsings>enable</ImplicitUsings>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is / should be specified in all .csproj files.

@bernardnormier bernardnormier merged commit ac11b0e into zeroc-ice:main Mar 10, 2025
8 checks passed
@bernardnormier bernardnormier deleted the cs-diag branch June 18, 2025 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants