-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15454 from tamasvajk/standalone/cshtml-default
C#: Change asp.net core view generation to be opt out
- Loading branch information
Showing
17 changed files
with
127 additions
and
7 deletions.
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
2 changes: 0 additions & 2 deletions
2
csharp/ql/integration-tests/all-platforms/cshtml_standalone/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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import os | ||
from create_database_utils import * | ||
|
||
|
||
os.environ['CODEQL_EXTRACTOR_CSHARP_STANDALONE_EXTRACT_WEB_VIEWS'] = 'true' | ||
run_codeql_database_create(lang="csharp", extra_args=["--extractor-option=buildless=true", "--extractor-option=cil=false"]) |
2 changes: 2 additions & 0 deletions
2
csharp/ql/integration-tests/all-platforms/cshtml_standalone_disabled/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,2 @@ | ||
| Program.cs | | ||
| test-db/working/implicitUsings/GlobalUsings.g.cs | |
20 changes: 20 additions & 0 deletions
20
csharp/ql/integration-tests/all-platforms/cshtml_standalone_disabled/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,20 @@ | ||
import csharp | ||
|
||
private string getPath(File f) { | ||
result = f.getRelativePath() and | ||
not exists( | ||
result | ||
.indexOf("_semmle_code_target_codeql_csharp_integration_tests_ql_csharp_ql_integration_tests_all_platforms_cshtml_standalone_") | ||
) | ||
or | ||
exists(int index | | ||
index = | ||
f.getRelativePath() | ||
.indexOf("_semmle_code_target_codeql_csharp_integration_tests_ql_csharp_ql_integration_tests_all_platforms_cshtml_standalone_") and | ||
result = f.getRelativePath().substring(index, f.getRelativePath().length()) | ||
) | ||
} | ||
|
||
from File f | ||
where f.fromSource() or f.getExtension() = "cshtml" | ||
select getPath(f) |
1 change: 1 addition & 0 deletions
1
csharp/ql/integration-tests/all-platforms/cshtml_standalone_disabled/Program.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 @@ | ||
var dummy = "dummy"; |
8 changes: 8 additions & 0 deletions
8
csharp/ql/integration-tests/all-platforms/cshtml_standalone_disabled/Views/Home/Index.cshtml
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,8 @@ | ||
@{ | ||
ViewData["Title"] = "Home Page"; | ||
} | ||
|
||
<div class="text-center"> | ||
<h1 class="display-4">Welcome</h1> | ||
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p> | ||
</div> |
14 changes: 14 additions & 0 deletions
14
csharp/ql/integration-tests/all-platforms/cshtml_standalone_disabled/cshtml.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,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<Target Name="DeleteBinObjFolders" BeforeTargets="Clean"> | ||
<RemoveDir Directories=".\bin" /> | ||
<RemoveDir Directories=".\obj" /> | ||
</Target> | ||
</Project> |
5 changes: 5 additions & 0 deletions
5
csharp/ql/integration-tests/all-platforms/cshtml_standalone_disabled/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.100" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
csharp/ql/integration-tests/all-platforms/cshtml_standalone_disabled/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,5 @@ | ||
import os | ||
from create_database_utils import * | ||
|
||
os.environ['CODEQL_EXTRACTOR_CSHARP_STANDALONE_EXTRACT_WEB_VIEWS'] = 'false' | ||
run_codeql_database_create(lang="csharp", extra_args=["--extractor-option=buildless=true", "--extractor-option=cil=false"]) |
2 changes: 0 additions & 2 deletions
2
csharp/ql/integration-tests/all-platforms/cshtml_standalone_flowsteps/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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import os | ||
from create_database_utils import * | ||
|
||
|
||
os.environ['CODEQL_EXTRACTOR_CSHARP_STANDALONE_EXTRACT_WEB_VIEWS'] = 'true' | ||
run_codeql_database_create(lang="csharp", extra_args=["--extractor-option=buildless=true", "--extractor-option=cil=false"]) |
4 changes: 4 additions & 0 deletions
4
csharp/ql/integration-tests/all-platforms/cshtml_standalone_net6/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,4 @@ | ||
| Program.cs | | ||
| Views/Home/Index.cshtml | | ||
| _semmle_code_target_codeql_csharp_integration_tests_ql_csharp_ql_integration_tests_all_platforms_cshtml_standalone_net6_Views_Home_Index_cshtml.g.cs | | ||
| test-db/working/implicitUsings/GlobalUsings.g.cs | |
20 changes: 20 additions & 0 deletions
20
csharp/ql/integration-tests/all-platforms/cshtml_standalone_net6/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,20 @@ | ||
import csharp | ||
|
||
private string getPath(File f) { | ||
result = f.getRelativePath() and | ||
not exists( | ||
result | ||
.indexOf("_semmle_code_target_codeql_csharp_integration_tests_ql_csharp_ql_integration_tests_all_platforms_cshtml_standalone_") | ||
) | ||
or | ||
exists(int index | | ||
index = | ||
f.getRelativePath() | ||
.indexOf("_semmle_code_target_codeql_csharp_integration_tests_ql_csharp_ql_integration_tests_all_platforms_cshtml_standalone_") and | ||
result = f.getRelativePath().substring(index, f.getRelativePath().length()) | ||
) | ||
} | ||
|
||
from File f | ||
where f.fromSource() or f.getExtension() = "cshtml" | ||
select getPath(f) |
1 change: 1 addition & 0 deletions
1
csharp/ql/integration-tests/all-platforms/cshtml_standalone_net6/Program.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 @@ | ||
var dummy = "dummy"; |
8 changes: 8 additions & 0 deletions
8
csharp/ql/integration-tests/all-platforms/cshtml_standalone_net6/Views/Home/Index.cshtml
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,8 @@ | ||
@{ | ||
ViewData["Title"] = "Home Page"; | ||
} | ||
|
||
<div class="text-center"> | ||
<h1 class="display-4">Welcome</h1> | ||
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p> | ||
</div> |
14 changes: 14 additions & 0 deletions
14
csharp/ql/integration-tests/all-platforms/cshtml_standalone_net6/cshtml.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,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<Target Name="DeleteBinObjFolders" BeforeTargets="Clean"> | ||
<RemoveDir Directories=".\bin" /> | ||
<RemoveDir Directories=".\obj" /> | ||
</Target> | ||
</Project> |
5 changes: 5 additions & 0 deletions
5
csharp/ql/integration-tests/all-platforms/cshtml_standalone_net6/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": "6.0.418" | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
csharp/ql/integration-tests/all-platforms/cshtml_standalone_net6/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,4 @@ | ||
import os | ||
from create_database_utils import * | ||
|
||
run_codeql_database_create(lang="csharp", extra_args=["--extractor-option=buildless=true", "--extractor-option=cil=false"]) |