1
- using Semmle . Extraction . CSharp ;
1
+ using Semmle . Extraction . CSharp ;
2
2
using Semmle . Util . Logging ;
3
3
using Semmle . Autobuild . Shared ;
4
4
using Semmle . Util ;
5
5
using System . Linq ;
6
- using System . Collections . Generic ;
7
6
8
7
namespace Semmle . Autobuild . CSharp
9
8
{
@@ -99,6 +98,7 @@ protected override void AutobuildFailureDiagnostic()
99
98
if ( this . autoBuildRule . BuildCommandAutoRule . ScriptPath is not null )
100
99
{
101
100
DiagnosticMessage message ;
101
+ var relScriptPath = this . MakeRelative ( autoBuildRule . BuildCommandAutoRule . ScriptPath ) ;
102
102
103
103
// if we found multiple build scripts in the project directory, then we can say
104
104
// as much to indicate that we may have picked the wrong one;
@@ -108,7 +108,7 @@ protected override void AutobuildFailureDiagnostic()
108
108
message = MakeDiagnostic ( "multiple-build-scripts" , "There are multiple potential build scripts" ) ;
109
109
message . MarkdownMessage =
110
110
"CodeQL found multiple potential build scripts for your project and " +
111
- $ "attempted to run `{ autoBuildRule . BuildCommandAutoRule . ScriptPath } `, which failed. " +
111
+ $ "attempted to run `{ relScriptPath } `, which failed. " +
112
112
"This may not be the right build script for your project. " +
113
113
$ "Set up a [manual build command]({ buildCommandDocsUrl } ).";
114
114
}
@@ -117,7 +117,7 @@ protected override void AutobuildFailureDiagnostic()
117
117
message = MakeDiagnostic ( "script-failure" , "Unable to build project using build script" ) ;
118
118
message . MarkdownMessage =
119
119
"CodeQL attempted to build your project using a script located at " +
120
- $ "`{ autoBuildRule . BuildCommandAutoRule . ScriptPath } `, which failed. " +
120
+ $ "`{ relScriptPath } `, which failed. " +
121
121
$ "Set up a [manual build command]({ buildCommandDocsUrl } ).";
122
122
}
123
123
@@ -142,7 +142,7 @@ protected override void AutobuildFailureDiagnostic()
142
142
var message = MakeDiagnostic ( "dotnet-incompatible-projects" , "Some projects are incompatible with .NET Core" ) ;
143
143
message . MarkdownMessage =
144
144
"CodeQL found some projects which cannot be built with .NET Core:\n " +
145
- autoBuildRule . DotNetRule . NotDotNetProjects . ToMarkdownList ( 5 ) ;
145
+ autoBuildRule . DotNetRule . NotDotNetProjects . Select ( p => this . MakeRelative ( p . FullPath ) ) . ToMarkdownList ( MarkdownUtil . CodeFormatter , 5 ) ;
146
146
message . Severity = DiagnosticMessage . TspSeverity . Warning ;
147
147
148
148
AddDiagnostic ( message ) ;
@@ -154,7 +154,7 @@ protected override void AutobuildFailureDiagnostic()
154
154
var message = MakeDiagnostic ( "dotnet-build-failure" , "Some projects or solutions failed to build using .NET Core" ) ;
155
155
message . MarkdownMessage =
156
156
"CodeQL was unable to build the following projects using .NET Core:\n " +
157
- autoBuildRule . DotNetRule . FailedProjectsOrSolutions . ToMarkdownList ( 10 ) +
157
+ autoBuildRule . DotNetRule . FailedProjectsOrSolutions . Select ( p => this . MakeRelative ( p . FullPath ) ) . ToMarkdownList ( MarkdownUtil . CodeFormatter , 10 ) +
158
158
$ "\n Set up a [manual build command]({ buildCommandDocsUrl } ).";
159
159
message . Severity = DiagnosticMessage . TspSeverity . Error ;
160
160
@@ -167,7 +167,7 @@ protected override void AutobuildFailureDiagnostic()
167
167
var message = MakeDiagnostic ( "msbuild-build-failure" , "Some projects or solutions failed to build using MSBuild" ) ;
168
168
message . MarkdownMessage =
169
169
"CodeQL was unable to build the following projects using MSBuild:\n " +
170
- autoBuildRule . MsBuildRule . FailedProjectsOrSolutions . ToMarkdownList ( 10 ) +
170
+ autoBuildRule . MsBuildRule . FailedProjectsOrSolutions . Select ( p => this . MakeRelative ( p . FullPath ) ) . ToMarkdownList ( MarkdownUtil . CodeFormatter , 10 ) +
171
171
$ "\n Set up a [manual build command]({ buildCommandDocsUrl } ).";
172
172
message . Severity = DiagnosticMessage . TspSeverity . Error ;
173
173
0 commit comments