Annotate auto-generated code
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Start by locating the source generator that emits files such as Functions_Handle_Generated.g.cs and tracing how it builds the generated header and type declarations. Add the requested generated-code and coverage annotations to generated types and applicable members, and replace the header with the descriptive block shown in the issue. Verify generated output includes these annotations and header.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the feature
The source generator's output (e.g. Functions_Handle_Generated.g.cs) has no attributes that identify it as
generated code, and only the minimal // <auto-generated/> header. Please:
- Add
[GeneratedCode("<tool>", "<version>")]to every generated type (and member where it applies). - Replace the one-line header with the standard descriptive
<auto-generated>block. - Add
[ExcludeFromCodeCoverage]to generated types.
Use Case
As a developer enforcing code-quality gates (coverage thresholds, static analysis) on Lambda projects,
I need the generated handler code to identify itself as generated ([GeneratedCode], [ExcludeFromCodeCoverage] and a full <auto-generated> header),
so that coverage and analysis tools exclude it automatically, without per-repository exclusion rules.
Today the generated *_Generated class is indistinguishable from hand-written code once compiled. It lowers
reported coverage, appears in analyzer and mutation-testing results, and cannot be annotated by the user. Each
repository has to maintain its own tool-specific exclusion.
Proposed Solution
Generated code is annotated with
<auto-generated>commentGeneratedCodeattributeExcludeFromCoverageattribute
Sample output:
// <auto-generated>
// This code was generated by a tool (Amazon.Lambda.Annotations.SourceGenerator 2.4.1.0).
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
using System;
...
namespace Acme.EventDistributor.Trigger
{
/// <summary>
/// The generated Lambda function handler for <see cref="Acme.EventDistributor.Trigger.Functions"/>.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Amazon.Lambda.Annotations.SourceGenerator", "2.4.1.0")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public class Functions_Handle_Generated
{
Other Information
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
AWS .NET SDK and/or Package version used
Amazon.Lambda.Annotations 2.4.1.0
Targeted .NET Platform
.NET SDK 10.0.401
Operating System and version
Windows 11
- Ngôn ngữ chính
- C#
- Star
- 1.7k
- Fork
- 505
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws/aws-lambda-dotnet
-
bug module/aspnetcore-support p2 queued
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
aws/aws-lambda-dotnet#1123 · 4 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Generated XML doc `cref` contains unescaped generic arguments: CS1584 / CS1658 / CS1570 warningsCó thể đã có người làm @reginaldalfret đã nhận 6 ngày trước. Đang mởbug needs-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
aws/aws-lambda-dotnet#2587 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
aws/aws-lambda-dotnet#2586 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature-request p2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
aws/aws-lambda-dotnet#2551 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
JSON log format pairs ILogger message template placeholders with state values by position, garbling ASP.NET Core hosting logsCó thể đã có người làm @Pybsama đã nhận 77 ngày trước. Đang mởbug investigating p2
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
aws/aws-lambda-dotnet#2468 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aws/aws-lambda-dotnet
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Attention: a throwing permission check on one contributor fails the whole aggregation requestĐang mởready-for-agent size:S status:todo
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
elsa-workflows/elsa-foundation#2830 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Review - Maintainer WG-Maintainers-Build
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
PowerShell/PowerShell#28220 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: docs eco: dotnet good first issue help wanted lane: free-agent roadmap size: XS type: docs
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 72/100
arminazimi/evergreen#377 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày