Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 08401b4

Browse filesBrowse files
committed
C#: Relax dotnet rule.
1 parent 6dbdc9e commit 08401b4
Copy full SHA for 08401b4

File tree

2 files changed

+7
-3
lines changed
Filter options

2 files changed

+7
-3
lines changed

‎csharp/autobuilder/Semmle.Autobuild.CSharp/DotNetRule.cs

Copy file name to clipboardExpand all lines: csharp/autobuilder/Semmle.Autobuild.CSharp/DotNetRule.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public BuildScript Analyse(IAutobuilder<CSharpAutobuildOptions> builder, bool au
3434
NotDotNetProjects = builder.ProjectsOrSolutionsToBuild
3535
.SelectMany(p => new[] { p }.Concat(p.IncludedProjects))
3636
.OfType<Project<CSharpAutobuildOptions>>()
37-
.Where(p => !p.DotNetProject);
37+
.Where(p => !p.MaybeDotNetProject);
3838
var notDotNetProject = NotDotNetProjects.FirstOrDefault();
3939

4040
if (notDotNetProject is not null)

‎csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs

Copy file name to clipboardExpand all lines: csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class Project<TAutobuildOptions> : ProjectOrSolution<TAutobuildOptions> w
1717
/// <summary>
1818
/// Holds if this project is for .Net core.
1919
/// </summary>
20-
public bool DotNetProject { get; private set; }
20+
public bool MaybeDotNetProject { get; init; }
2121

2222
public bool ValidToolsVersion { get; private set; }
2323

@@ -32,7 +32,11 @@ public Project(Autobuilder<TAutobuildOptions> builder, string path) : base(build
3232
includedProjectsLazy = new Lazy<List<Project<TAutobuildOptions>>>(() => new List<Project<TAutobuildOptions>>());
3333

3434
if (!builder.Actions.FileExists(FullPath))
35+
{
36+
// We can't out-rule that this is a dotnet project.
37+
MaybeDotNetProject = true;
3538
return;
39+
}
3640

3741
XmlDocument projFile;
3842
try
@@ -51,7 +55,7 @@ public Project(Autobuilder<TAutobuildOptions> builder, string path) : base(build
5155
{
5256
if (root.HasAttribute("Sdk"))
5357
{
54-
DotNetProject = true;
58+
MaybeDotNetProject = true;
5559
return;
5660
}
5761

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.