-
Notifications
You must be signed in to change notification settings - Fork 491
Removing warnings from Amazon.Lambda.RuntimeSupport #2125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -463,19 +461,17 @@ private Task FormattedWriteLineAsync(string message) | |||
|
|||
public override Task WriteLineAsync(char value) => FormattedWriteLineAsync(value.ToString()); | |||
|
|||
public Task WriteLineAsync(char[] buffer) => FormattedWriteLineAsync(buffer == null ? String.Empty : new string(buffer)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method was deleted because it is not an actual method that can be overriden from the base class. It isn't marked as virtual
. We only need to override the WriteLineAsync(char[] buffer, int index, int count)
method. The base class calls that method setting the index to 0 and count to buffer.Length
.
@@ -540,18 +534,16 @@ public override string NewLine | |||
|
|||
public override Task WriteAsync(char[] buffer, int index, int count) => _innerWriter.WriteAsync(buffer, index, count); | |||
|
|||
public Task WriteAsync(char[] buffer) => _innerWriter.WriteAsync(buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method was deleted because it is not an actual method that can be overriden from the base class. It isn't marked as virtual
. We only need to override the WriteLineAsync(char[] buffer, int index, int count)
method. The base class calls that method setting the index to 0 and count to buffer.Length
.
…ng that warning is a larger effort.
8fa9adf
to
1558ecd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes warnings from Amazon.Lambda.RuntimeSupport to improve the development experience and enable treating warnings as errors for better code quality maintenance. No functional changes were made.
- Addressed various C# compiler warnings including readonly field declarations, pragma directives for .NET 10 compatibility, and XML documentation corrections
- Disabled warnings-as-errors temporarily and suppressed specific NuGet warnings (NU5048, NU1903) in project files
- Added missing XML documentation for public APIs and constructors
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
Amazon.Lambda.RuntimeSupport.csproj | Disabled warnings as errors and suppressed NuGet warnings |
SnapshotRestore.Registry.csproj | Disabled warnings as errors and suppressed NuGet warnings |
Program.cs | Added pragma directive to suppress IL2123 warning for .NET 10 compatibility |
ConsoleLoggerWriter.cs | Made fields readonly and removed unnecessary CLSCompliant attributes |
LambdaEnvironment.cs | Made field readonly and added XML documentation for properties |
LambdaContext.cs | Made Lazy fields readonly |
LambdaBootstrapConfiguration.cs | Fixed preprocessor directive structure |
InvocationResponse.cs | Added XML documentation for constructors |
InvocationRequest.cs | Added XML documentation for Dispose method |
InternalClientAdapted.cs | Made field readonly, removed 'this' qualifiers, and added XML documentation |
UserCodeValidator.cs | Fixed XML documentation ampersand encoding |
UserCodeLoader.cs | Removed unused exception documentation and fixed string interpolation |
LambdaBootstrapBuilder.cs | Added XML documentation for Build method |
LambdaBootstrap.cs | Added XML documentation, removed 'this' qualifiers, and improved Dispose pattern |
InvokeDelegateBuilder.cs | Fixed XML documentation and parameter descriptions |
HandlerWrapper.cs | Made field readonly, added XML documentation, and fixed HTML encoding in comments |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Libraries/src/Amazon.Lambda.RuntimeSupport/Context/LambdaEnvironment.cs
Outdated
Show resolved
Hide resolved
Libraries/src/Amazon.Lambda.RuntimeSupport/Client/InternalClientAdapted.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved, but can you fix the typos that copilot suggested too
Description of changes:
No functional changes in this PR. I just cleaned up the code to get rid of any warnings in Amazon.Lambda.RuntimeSupport to make it easier to develop on. I also enabled treat warnings as errors so we can keep the warnings down to 0.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.