mirror of
https://github.com/dotnet/skills.git
synced 2026-09-20 09:49:54 +08:00
4c40b873f2
Cover previously uncovered skill aspects: - [Validation] All .cs files in scope were scanned (check count) - [Validation] Report includes category totals, top patterns, and affected files - [Validation] obj/ and bin/ directories were excluded - [Pitfall] Scanning obj/ or generated code - [Pitfall] Missing statics inside lambdas/LINQ - [WorkflowStep] Step 4: Present the report Three new scenarios with supporting fixtures: - Structured report with file count, categories, and top patterns - Exclude obj/bin directories (with Generated.cs decoy in obj/) - Detect statics inside lambdas and LINQ expressions
25 lines
725 B
C#
25 lines
725 B
C#
namespace ObjExclusion.Services;
|
|
|
|
public class DataService
|
|
{
|
|
public void ProcessRecords(IEnumerable<string> records)
|
|
{
|
|
var timestamp = DateTime.UtcNow;
|
|
var outputPath = Path.Combine(
|
|
Environment.GetEnvironmentVariable("OUTPUT_DIR") ?? "/tmp",
|
|
"output.csv");
|
|
|
|
File.WriteAllText(outputPath, string.Join("\n",
|
|
records.Select(r => $"{timestamp:O},{r}")));
|
|
Console.WriteLine($"Processed {records.Count()} records at {timestamp}");
|
|
}
|
|
|
|
public string ReadLatestEntry(string logDir)
|
|
{
|
|
var files = Directory.GetFiles(logDir, "*.log");
|
|
if (files.Length == 0) return string.Empty;
|
|
|
|
return File.ReadAllText(files[0]);
|
|
}
|
|
}
|