up
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
global using System;
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.IO;
|
||||
global using System.IO.Compression;
|
||||
@@ -11,3 +11,5 @@ global using System.Threading;
|
||||
global using System.Threading.Tasks;
|
||||
|
||||
global using StellaOps.Scanner.Analyzers.Lang;
|
||||
|
||||
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("StellaOps.Scanner.Analyzers.Lang.Node.Tests")]
|
||||
|
||||
@@ -21,14 +21,8 @@ internal static class NodePhase22SampleLoader
|
||||
var fixturePath = Environment.GetEnvironmentVariable(EnvKey);
|
||||
if (string.IsNullOrWhiteSpace(fixturePath))
|
||||
{
|
||||
// Only load from the fixture root if explicitly present; do not fallback to docs/samples
|
||||
fixturePath = Path.Combine(rootPath, DefaultFileName);
|
||||
if (!File.Exists(fixturePath))
|
||||
{
|
||||
// fallback to docs sample if tests point to repo root
|
||||
var repoRoot = FindRepoRoot(rootPath);
|
||||
var fromDocs = Path.Combine(repoRoot, "docs", "samples", "scanner", "node-phase22", DefaultFileName);
|
||||
fixturePath = File.Exists(fromDocs) ? fromDocs : fixturePath;
|
||||
}
|
||||
}
|
||||
|
||||
if (!File.Exists(fixturePath))
|
||||
@@ -103,20 +97,4 @@ internal static class NodePhase22SampleLoader
|
||||
|
||||
return records;
|
||||
}
|
||||
|
||||
private static string FindRepoRoot(string start)
|
||||
{
|
||||
var current = new DirectoryInfo(start);
|
||||
while (current is not null && current.Exists)
|
||||
{
|
||||
if (File.Exists(Path.Combine(current.FullName, "README.md")))
|
||||
{
|
||||
return current.FullName;
|
||||
}
|
||||
|
||||
current = current.Parent;
|
||||
}
|
||||
|
||||
return start;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user