Annotate auto-generated code
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- C#
- スター
- 1.7k
- フォーク
- 505
- 平均マージ
- 1日 6時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aws/aws-lambda-dotnet のほかの issue
-
bug module/aspnetcore-support p2 queued
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
aws/aws-lambda-dotnet#1123 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Generated XML doc `cref` contains unescaped generic arguments: CS1584 / CS1658 / CS1570 warnings対応中かも @reginaldalfret が 6 日前に担当しました。 オープンbug needs-triage
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
aws/aws-lambda-dotnet#2587 ·
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
aws/aws-lambda-dotnet#2586 ·
メンテナーはふだん 1 日以内に返信
-
feature-request p2
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
aws/aws-lambda-dotnet#2551 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
JSON log format pairs ILogger message template placeholders with state values by position, garbling ASP.NET Core hosting logs対応中かも @Pybsama が 77 日前に担当しました。 オープンbug investigating p2
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
aws/aws-lambda-dotnet#2468 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
aws/aws-lambda-dotnet の issue をすべて見る
似ている issue
-
S: Untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Trauma-Station/Trauma-Station#5058 ·
メンテナーはふだん 1 日以内に返信
-
:books: documentation untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
documentation good first issue hacktoberfest
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
good first issue help wanted ready-for-human
難易度 2/5 半日 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信