Skip to content

Commit dc7cf27

Browse files
committed
Add no projects/solutions diagnostic
1 parent 55d7b74 commit dc7cf27

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

csharp/autobuilder/Semmle.Autobuild.CSharp/CSharpAutobuilder.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,16 @@ protected override void AutobuildFailureDiagnostic()
156156
};
157157
}
158158
}
159+
// both dotnet and msbuild builds require project or solution files; if we haven't found any
160+
// then neither of those rules would've worked
161+
else if (this.ProjectsOrSolutionsToBuild.Count == 0)
162+
{
163+
var source = GetDiagnosticSource("no-projects-or-solutions", "No project or solutions files found");
164+
message = new DiagnosticMessage(source)
165+
{
166+
PlaintextMessage = "CodeQL could not find any project or solution files in your repository."
167+
};
168+
}
159169
else
160170
{
161171
// none of the above apply; produce a generic autobuild failure message

0 commit comments

Comments
 (0)