Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

ExcludeFromCodeCoverage for interface with default implementations

オープン
#143 コメント 0 件 リアクション 1 件 担当者 1 名 GitHub で見る

@fhnaseer がすでに取り組んでいます。

2024年11月18日 から。

評価

この issue はまだ評価されていません。

説明

enhancement

Currently the ExcludeFromCodeCoverage attribute can only be placed on classes, constructors, methods, structs, properties, events and assemblies. However, now that C# 8.0 introduced interfaces with default implementations it could be useful to be able to be able to use the attribute on these as well.

As an example, in the visitor pattern I'm using an interface with default implementation so that visitors don't have to override every method:

public interface IVisitor
{
    void Visit(FullName fullName) => throw new NotImplementedException();
    void Visit(Address address) => throw new NotImplementedException();
    void Visit(PhoneInfo phoneInfo) => throw new NotImplementedException();
}

Since testing these concrete methods (in my case) is not necessary, I would like to tag the interface with the ExcludeFromCodeCoverage attribute which is currently not possible. While I've got a few workarounds (adding the ExcludeFromCodeCoverage attribute to every single method declaration in the interface or using an abstract class and tagging the class itself) it might be worth letting the attribute be placed directly on interfaces.

主要言語
C#
スター
125
フォーク
17
平均マージ
1時間 17分
マージ済み PR(30日)
2

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/codecoverage のほかの issue

microsoft/codecoverage の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。