-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C#: Change extractor to accept multiple binlog
files
#17955
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
csharp/ql/integration-tests/all-platforms/binlog_multiple/Files.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
| a/A.cs:0:0:0:0 | a/A.cs | | ||
| a/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs:0:0:0:0 | a/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | | ||
| a/obj/Debug/net8.0/test.AssemblyInfo.cs:0:0:0:0 | a/obj/Debug/net8.0/test.AssemblyInfo.cs | | ||
| a/obj/Debug/net8.0/test.GlobalUsings.g.cs:0:0:0:0 | a/obj/Debug/net8.0/test.GlobalUsings.g.cs | | ||
| b/B.cs:0:0:0:0 | b/B.cs | | ||
| b/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs:0:0:0:0 | b/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | | ||
| b/obj/Debug/net8.0/test.AssemblyInfo.cs:0:0:0:0 | b/obj/Debug/net8.0/test.AssemblyInfo.cs | | ||
| b/obj/Debug/net8.0/test.GlobalUsings.g.cs:0:0:0:0 | b/obj/Debug/net8.0/test.GlobalUsings.g.cs | | ||
| generated/a/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs:0:0:0:0 | generated/a/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs | | ||
| generated/b/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs:0:0:0:0 | generated/b/test.csproj (net8.0)/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs | |
5 changes: 5 additions & 0 deletions
5
csharp/ql/integration-tests/all-platforms/binlog_multiple/Files.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import csharp | ||
|
||
from File f | ||
where f.fromSource() | ||
select f |
9 changes: 9 additions & 0 deletions
9
csharp/ql/integration-tests/all-platforms/binlog_multiple/a/A.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Text.RegularExpressions; | ||
|
||
var dummy = "dummy"; | ||
|
||
partial class Test | ||
{ | ||
[GeneratedRegex("abc|def", RegexOptions.IgnoreCase, "en-US")] | ||
private static partial Regex AbcOrDefGeneratedRegex(); | ||
} |
10 changes: 10 additions & 0 deletions
10
csharp/ql/integration-tests/all-platforms/binlog_multiple/a/test.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
9 changes: 9 additions & 0 deletions
9
csharp/ql/integration-tests/all-platforms/binlog_multiple/b/B.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Text.RegularExpressions; | ||
|
||
var dummy = "dummy"; | ||
|
||
partial class Test | ||
{ | ||
[GeneratedRegex("abc|def", RegexOptions.IgnoreCase, "en-US")] | ||
private static partial Regex AbcOrDefGeneratedRegex(); | ||
} |
10 changes: 10 additions & 0 deletions
10
csharp/ql/integration-tests/all-platforms/binlog_multiple/b/test.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
42 changes: 42 additions & 0 deletions
42
csharp/ql/integration-tests/all-platforms/binlog_multiple/diagnostics.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"markdownMessage": "C# analysis with build-mode 'none' completed.", | ||
"severity": "unknown", | ||
"source": { | ||
"extractorName": "csharp", | ||
"id": "csharp/autobuilder/buildless/complete", | ||
"name": "C# analysis with build-mode 'none' completed" | ||
}, | ||
"visibility": { | ||
"cliSummaryTable": true, | ||
"statusPage": false, | ||
"telemetry": true | ||
} | ||
} | ||
{ | ||
"markdownMessage": "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as Nuget and Dotnet CLIs, only contributing information about external dependencies.", | ||
"severity": "note", | ||
"source": { | ||
"extractorName": "csharp", | ||
"id": "csharp/autobuilder/buildless/mode-active", | ||
"name": "C# was extracted with build-mode set to 'none'" | ||
}, | ||
"visibility": { | ||
"cliSummaryTable": true, | ||
"statusPage": true, | ||
"telemetry": true | ||
} | ||
} | ||
{ | ||
"markdownMessage": "C# was extracted with the experimental 'binlog' option.", | ||
"severity": "note", | ||
"source": { | ||
"extractorName": "csharp", | ||
"id": "csharp/autobuilder/buildless/binlog", | ||
"name": "C# was extracted with the experimental 'binlog' option" | ||
}, | ||
"visibility": { | ||
"cliSummaryTable": true, | ||
"statusPage": true, | ||
"telemetry": true | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
csharp/ql/integration-tests/all-platforms/binlog_multiple/global.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sdk": { | ||
"version": "8.0.101" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
csharp/ql/integration-tests/all-platforms/binlog_multiple/test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import commands | ||
|
||
|
||
def test(codeql, csharp): | ||
commands.run(["dotnet", "build", "a/test.csproj", "/bl:a.binlog"]) | ||
commands.run(["dotnet", "build", "b/test.csproj", "/bl:b.binlog"]) | ||
codeql.database.create(build_mode="none", extractor_option=["binlog=a.binlog", "binlog=b.binlog"]) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the motivation for returning
ExitCode.Failed
only when all analyses failed instead of just a single failure?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember any longer why I opted for this originally.