IBuildAuditor
Pennington.Generation
A build-time auditor that inspects discovered content and produces BuildDiagnostics. Auditors run during dev-mode startup and on file changes (results feed the diagnostic overlay), and again at build time (results land in Diagnostics).
Implement and register via services.AddTransient<IBuildAuditor, MyAuditor>(). Auditors should be cheap to invoke repeatedly because the runner re-runs every registered auditor on every content-tree change.
Properties
Codestring- Stable identifier for the auditor (e.g.
translation.audit). Surfaced onBuildDiagnostics via the source label so users can filter or suppress by code in CI dashboards.
Methods
AuditAsync
#public Task<IReadOnlyList<BuildDiagnostic>> AuditAsync(BuildAuditContext context, CancellationToken cancellationToken)
Runs the auditor against context and returns its diagnostics.
Parameters
contextBuildAuditContextcancellationTokenCancellationToken
Returns
Task<IReadOnlyList<BuildDiagnostic>>Pennington.Generation.IBuildAuditor
namespace Pennington.Generation;
/// A build-time auditor that inspects discovered content and produces BuildDiagnostics. Auditors run during dev-mode startup and on file changes (results feed the diagnostic overlay), and again at build time (results land in Diagnostics). Implement and register via services.AddTransient<IBuildAuditor, MyAuditor>(). Auditors should be cheap to invoke repeatedly because the runner re-runs every registered auditor on every content-tree change.
public interface IBuildAuditor
{
/// Runs the auditor against context and returns its diagnostics.
public Task<IReadOnlyList<BuildDiagnostic>> AuditAsync(BuildAuditContext context, CancellationToken cancellationToken)
;
/// Stable identifier for the auditor (e.g. translation.audit). Surfaced on BuildDiagnostics via the source label so users can filter or suppress by code in CI dashboards.
public string Code { get; }
}