From e8d574438ce996e67bc6a5be806cd2b2285b094a Mon Sep 17 00:00:00 2001 From: TimoKuronen Date: Thu, 10 Sep 2026 10:19:35 +0300 Subject: [PATCH] Put target file name before timestamp in report files - Rename reports to File_yyyyMMdd_HHmmss_Critique.md - Assert naming in engine tests; update README and sample excerpt --- CodeSmellAuditor.Core.Tests/AuditEngineTests.cs | 4 ++++ CodeSmellAuditor.Core/AuditEngine.cs | 2 +- README.md | 2 +- docs/sample-report-excerpt.md | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) 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