Skip to content

Commit fdf253f

Browse files
thomhurstclaude
andauthored
docs: Add XML documentation to DotNetExtensions, GitExtensions, and BooleanExtensions (#1671)
Add comprehensive XML documentation to extension classes: - DotNetExtensions: Document class, registration methods, and context accessors - GitExtensions: Document class, registration methods, and context accessor - BooleanExtensions: Document class and AsSkipDecisionIfTrue method Fixes #1590 Fixes #1575 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5369493 commit fdf253f

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

src/ModularPipelines.DotNet/Extensions/DotNetExtensions.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@
99

1010
namespace ModularPipelines.DotNet.Extensions;
1111

12+
/// <summary>
13+
/// Provides extension methods for integrating .NET CLI functionality into the ModularPipelines framework.
14+
/// </summary>
1215
[ExcludeFromCodeCoverage]
1316
public static class DotNetExtensions
1417
{
18+
/// <summary>
19+
/// Automatically registers the .NET context services with the ModularPipelines framework.
20+
/// This method is called by the module initializer and should not be called directly.
21+
/// </summary>
1522
#pragma warning disable CA2255
1623
[ModuleInitializer]
1724
#pragma warning restore CA2255
@@ -20,6 +27,12 @@ public static void RegisterDotNetContext()
2027
ModularPipelinesContextRegistry.RegisterContext(collection => RegisterDotNetContext(collection));
2128
}
2229

30+
/// <summary>
31+
/// Registers .NET CLI services with the dependency injection container.
32+
/// This includes services for running dotnet commands such as build, test, pack, publish, and NuGet operations.
33+
/// </summary>
34+
/// <param name="services">The service collection to add the .NET services to.</param>
35+
/// <returns>The service collection for method chaining.</returns>
2336
public static IServiceCollection RegisterDotNetContext(this IServiceCollection services)
2437
{
2538
services.TryAddScoped<ITrxParser, TrxParser>();
@@ -43,7 +56,19 @@ public static IServiceCollection RegisterDotNetContext(this IServiceCollection s
4356
return services;
4457
}
4558

59+
/// <summary>
60+
/// Gets the .NET CLI service from the pipeline context.
61+
/// This provides access to dotnet commands such as build, test, pack, publish, and more.
62+
/// </summary>
63+
/// <param name="context">The pipeline hook context.</param>
64+
/// <returns>The <see cref="IDotNet"/> service for executing .NET CLI commands.</returns>
4665
public static IDotNet DotNet(this IPipelineHookContext context) => context.ServiceProvider.GetRequiredService<IDotNet>();
4766

67+
/// <summary>
68+
/// Gets the TRX (Test Results XML) parser service from the pipeline context.
69+
/// This provides access to parse and analyze .NET test result files.
70+
/// </summary>
71+
/// <param name="context">The pipeline hook context.</param>
72+
/// <returns>The <see cref="ITrx"/> service for parsing TRX test result files.</returns>
4873
public static ITrx Trx(this IPipelineHookContext context) => context.ServiceProvider.GetRequiredService<ITrx>();
4974
}

src/ModularPipelines.Git/Extensions/GitExtensions.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@
77

88
namespace ModularPipelines.Git.Extensions;
99

10+
/// <summary>
11+
/// Provides extension methods for integrating Git functionality into the ModularPipelines framework.
12+
/// </summary>
1013
[ExcludeFromCodeCoverage]
1114
public static class GitExtensions
1215
{
16+
/// <summary>
17+
/// Automatically registers the Git context services with the ModularPipelines framework.
18+
/// This method is called by the module initializer and should not be called directly.
19+
/// </summary>
1320
#pragma warning disable CA2255
1421
[ModuleInitializer]
1522
#pragma warning restore CA2255
@@ -18,6 +25,12 @@ public static void RegisterGitContext()
1825
ModularPipelinesContextRegistry.RegisterContext(collection => RegisterGitContext(collection));
1926
}
2027

28+
/// <summary>
29+
/// Registers Git services with the dependency injection container.
30+
/// This includes services for running Git commands and accessing repository information.
31+
/// </summary>
32+
/// <param name="services">The service collection to add the Git services to.</param>
33+
/// <returns>The service collection for method chaining.</returns>
2134
public static IServiceCollection RegisterGitContext(this IServiceCollection services)
2235
{
2336
services.TryAddScoped<IGit, Git>();
@@ -29,5 +42,11 @@ public static IServiceCollection RegisterGitContext(this IServiceCollection serv
2942
return services;
3043
}
3144

45+
/// <summary>
46+
/// Gets the Git service from the pipeline context.
47+
/// This provides access to Git commands and repository information.
48+
/// </summary>
49+
/// <param name="context">The pipeline hook context.</param>
50+
/// <returns>The <see cref="IGit"/> service for executing Git commands and accessing repository information.</returns>
3251
public static IGit Git(this IPipelineHookContext context) => context.ServiceProvider.GetRequiredService<IGit>();
3352
}

src/ModularPipelines/Extensions/BooleanExtensions.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,19 @@
22

33
namespace ModularPipelines.Extensions;
44

5+
/// <summary>
6+
/// Provides extension methods for <see cref="bool"/> values.
7+
/// </summary>
58
public static class BooleanExtensions
69
{
10+
/// <summary>
11+
/// Converts a boolean value to a <see cref="SkipDecision"/>.
12+
/// If the value is <c>true</c>, returns a skip decision with the specified reason.
13+
/// If the value is <c>false</c>, returns <see cref="SkipDecision.DoNotSkip"/>.
14+
/// </summary>
15+
/// <param name="value">The boolean value to evaluate.</param>
16+
/// <param name="reason">The reason for skipping if the value is <c>true</c>.</param>
17+
/// <returns>A <see cref="SkipDecision"/> based on the boolean value.</returns>
718
public static SkipDecision AsSkipDecisionIfTrue(this bool value, string reason)
819
{
920
if (value)

0 commit comments

Comments
 (0)