Skip to content

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

Merged
merged 8 commits into from
Aug 19, 2025
Merged

Conversation

normj
Copy link
Member

@normj normj commented Aug 18, 2025

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.

@normj normj added the Release Not Needed Add this label if a PR does not need to be released. label Aug 18, 2025
@@ -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));
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 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);
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 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.

@normj normj force-pushed the normj/code-cleanup branch from 8fa9adf to 1558ecd Compare August 19, 2025 06:22
Copy link

@Copilot 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.

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.

Copy link
Contributor

@GarrettBeatty GarrettBeatty left a 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

@dscpinheiro dscpinheiro requested a review from philasmar August 19, 2025 17:31
@normj normj merged commit 7f55253 into dev Aug 19, 2025
9 of 10 checks passed
@normj normj deleted the normj/code-cleanup branch August 19, 2025 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Not Needed Add this label if a PR does not need to be released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants