mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Simplify generated file paths
This commit is contained in:
@@ -1,5 +1,19 @@
|
||||
import csharp
|
||||
|
||||
private string getPath(File f) {
|
||||
result = f.getRelativePath() and
|
||||
not exists(result.indexOf("_ql_csharp_ql_integration_tests_blazor_build_mode_none_"))
|
||||
or
|
||||
exists(int index1, int index2, string pattern |
|
||||
pattern = "Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator" and
|
||||
index1 = f.getRelativePath().indexOf(pattern) and
|
||||
index2 = f.getRelativePath().indexOf("_ql_csharp_ql_integration_tests_blazor_build_mode_none_") and
|
||||
result =
|
||||
f.getRelativePath().substring(0, index1 + pattern.length()) + "/[...]" +
|
||||
f.getRelativePath().substring(index2, f.getRelativePath().length())
|
||||
)
|
||||
}
|
||||
|
||||
from File f
|
||||
where f.fromSource() or f.getExtension() = "razor"
|
||||
select f
|
||||
select getPath(f)
|
||||
|
||||
Reference in New Issue
Block a user