34 lines
871 B
C#
34 lines
871 B
C#
using MarketAlly.GitCommitEditor.Models;
|
|
using MarketAlly.GitCommitEditor.Options;
|
|
|
|
namespace MarketAlly.GitCommitEditor.Services;
|
|
|
|
/// <summary>
|
|
/// Simple commit message analyzer for health analysis.
|
|
/// </summary>
|
|
public interface ICommitAnalyzer
|
|
{
|
|
/// <summary>
|
|
/// Analyzes a commit message and returns quality information.
|
|
/// </summary>
|
|
MessageQualityScore Analyze(string message);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Default implementation using the existing analyzer.
|
|
/// </summary>
|
|
public sealed class CommitAnalyzer : ICommitAnalyzer
|
|
{
|
|
private readonly ICommitMessageAnalyzer _analyzer;
|
|
|
|
public CommitAnalyzer(CommitMessageRules? rules = null)
|
|
{
|
|
_analyzer = new CommitMessageAnalyzer(rules ?? new CommitMessageRules());
|
|
}
|
|
|
|
public MessageQualityScore Analyze(string message)
|
|
{
|
|
return _analyzer.Analyze(message);
|
|
}
|
|
}
|