1- using Semmle . Extraction . CSharp ;
1+ using Semmle . Extraction . CSharp ;
22using Semmle . Util . Logging ;
33using Semmle . Autobuild . Shared ;
44using Semmle . Util ;
55using System . Linq ;
6- using System . Collections . Generic ;
76
87namespace Semmle . Autobuild . CSharp
98{
@@ -99,6 +98,7 @@ protected override void AutobuildFailureDiagnostic()
9998 if ( this . autoBuildRule . BuildCommandAutoRule . ScriptPath is not null )
10099 {
101100 DiagnosticMessage message ;
101+ var relScriptPath = this . MakeRelative ( autoBuildRule . BuildCommandAutoRule . ScriptPath ) ;
102102
103103 // if we found multiple build scripts in the project directory, then we can say
104104 // as much to indicate that we may have picked the wrong one;
@@ -108,7 +108,7 @@ protected override void AutobuildFailureDiagnostic()
108108 message = MakeDiagnostic ( "multiple-build-scripts" , "There are multiple potential build scripts" ) ;
109109 message . MarkdownMessage =
110110 "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. " +
112112 "This may not be the right build script for your project. " +
113113 $ "Set up a [manual build command]({ buildCommandDocsUrl } ).";
114114 }
@@ -117,7 +117,7 @@ protected override void AutobuildFailureDiagnostic()
117117 message = MakeDiagnostic ( "script-failure" , "Unable to build project using build script" ) ;
118118 message . MarkdownMessage =
119119 "CodeQL attempted to build your project using a script located at " +
120- $ "`{ autoBuildRule . BuildCommandAutoRule . ScriptPath } `, which failed. " +
120+ $ "`{ relScriptPath } `, which failed. " +
121121 $ "Set up a [manual build command]({ buildCommandDocsUrl } ).";
122122 }
123123
@@ -142,7 +142,7 @@ protected override void AutobuildFailureDiagnostic()
142142 var message = MakeDiagnostic ( "dotnet-incompatible-projects" , "Some projects are incompatible with .NET Core" ) ;
143143 message . MarkdownMessage =
144144 "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 ) ;
146146 message . Severity = DiagnosticMessage . TspSeverity . Warning ;
147147
148148 AddDiagnostic ( message ) ;
@@ -154,7 +154,7 @@ protected override void AutobuildFailureDiagnostic()
154154 var message = MakeDiagnostic ( "dotnet-build-failure" , "Some projects or solutions failed to build using .NET Core" ) ;
155155 message . MarkdownMessage =
156156 "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 ) +
158158 $ "\n Set up a [manual build command]({ buildCommandDocsUrl } ).";
159159 message . Severity = DiagnosticMessage . TspSeverity . Error ;
160160
@@ -167,7 +167,7 @@ protected override void AutobuildFailureDiagnostic()
167167 var message = MakeDiagnostic ( "msbuild-build-failure" , "Some projects or solutions failed to build using MSBuild" ) ;
168168 message . MarkdownMessage =
169169 "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 ) +
171171 $ "\n Set up a [manual build command]({ buildCommandDocsUrl } ).";
172172 message . Severity = DiagnosticMessage . TspSeverity . Error ;
173173
0 commit comments