diff --git a/CodeSmellAuditor.Core.Tests/AuditEngineTests.cs b/CodeSmellAuditor.Core.Tests/AuditEngineTests.cs index 599e4ae..afd81d1 100644 --- a/CodeSmellAuditor.Core.Tests/AuditEngineTests.cs +++ b/CodeSmellAuditor.Core.Tests/AuditEngineTests.cs @@ -33,6 +33,10 @@ public async Task AuditFileAsync_WritesReportAndReturnsPassFailResult() Assert.False(result.HasPassed); Assert.True(File.Exists(result.ReportPath)); + string reportFileName = Path.GetFileName(result.ReportPath); + Assert.StartsWith("Sample_", reportFileName); + Assert.EndsWith("_Critique.md", reportFileName); + string savedReport = await File.ReadAllTextAsync(result.ReportPath); Assert.Contains("TargetFile: Sample.cs", savedReport); Assert.Contains("Status: REVIEW REQUIRED", savedReport); diff --git a/CodeSmellAuditor.Core/AuditEngine.cs b/CodeSmellAuditor.Core/AuditEngine.cs index b328b46..4aab437 100644 --- a/CodeSmellAuditor.Core/AuditEngine.cs +++ b/CodeSmellAuditor.Core/AuditEngine.cs @@ -90,7 +90,7 @@ private static async Task SaveReportToFileSystemAsync( string markdownContent) { string timestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss"); - string cleanFileName = $"{timestamp}_{Path.GetFileNameWithoutExtension(targetFileName)}_Critique.md"; + string cleanFileName = $"{Path.GetFileNameWithoutExtension(targetFileName)}_{timestamp}_Critique.md"; string fullOutputPath = Path.Combine(targetFolder, cleanFileName); var documentBuilder = new StringBuilder(); diff --git a/README.md b/README.md index bb740ba..f8cdda6 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This is an **AI-assisted semantic code reviewer**, not a deterministic static an - Batch mode via `WorkstationStorage/Targets/` and path-based `sniff` for files in place - Local Ollama only — source stays on your machine - Streaming terminal output with Spectre Status spinner until first token -- Timestamped markdown reports under `WorkstationStorage/Reports/` +- Timestamped markdown reports under `WorkstationStorage/Reports/` (`{File}_{yyyyMMdd_HHmmss}_Critique.md`) - Pass/fail parsed from a `Status:` line in the report; batch and sniff set process exit codes (`0`/`1`) - Batch mode prints a pass/fail summary after all Targets files; waits for Enter unless `--non-interactive` - CLI flags: `--model`, `--storage`, `--non-interactive` (env vars `CODESMELL_MODEL` / `CODESMELL_STORAGE` override flags when set) diff --git a/docs/sample-report-excerpt.md b/docs/sample-report-excerpt.md index c7f9438..109aa53 100644 --- a/docs/sample-report-excerpt.md +++ b/docs/sample-report-excerpt.md @@ -5,10 +5,10 @@ This excerpt shows the report structure generated by CodeSmellAuditor. ## File naming ``` -{yyyyMMdd_HHmmss}_{TargetFileNameWithoutExtension}_Critique.md +{TargetFileNameWithoutExtension}_{yyyyMMdd_HHmmss}_Critique.md ``` -Example: `20260707_120000_SampleService_Critique.md` +Example: `SampleService_20260707_120000_Critique.md` ## Front matter