Skip to content

Commit 4903924

Browse files
committed
Apply ql-for-ql suggestion
1 parent f22c864 commit 4903924

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,14 @@ protected override void AutobuildFailureDiagnostic()
9797
// run and found at least one script to execute
9898
if (this.autoBuildRule.BuildCommandAutoRule.ScriptPath is not null)
9999
{
100-
DiagnosticMessage message;
101100
var relScriptPath = this.MakeRelative(autoBuildRule.BuildCommandAutoRule.ScriptPath);
102101

103102
// if we found multiple build scripts in the project directory, then we can say
104103
// as much to indicate that we may have picked the wrong one;
105104
// otherwise, we just report that the one script we found didn't work
106-
if (this.autoBuildRule.BuildCommandAutoRule.CandidatePaths.Count() > 1)
107-
{
108-
message = new(
105+
DiagnosticMessage message =
106+
this.autoBuildRule.BuildCommandAutoRule.CandidatePaths.Count() > 1 ?
107+
new(
109108
this.Options.Language,
110109
"multiple-build-scripts",
111110
"There are multiple potential build scripts",
@@ -114,11 +113,8 @@ protected override void AutobuildFailureDiagnostic()
114113
$"attempted to run `{relScriptPath}`, which failed. " +
115114
"This may not be the right build script for your project. " +
116115
$"Set up a [manual build command]({buildCommandDocsUrl})."
117-
);
118-
}
119-
else
120-
{
121-
message = new(
116+
) :
117+
new(
122118
this.Options.Language,
123119
"script-failure",
124120
"Unable to build project using build script",
@@ -127,7 +123,6 @@ protected override void AutobuildFailureDiagnostic()
127123
$"`{relScriptPath}`, which failed. " +
128124
$"Set up a [manual build command]({buildCommandDocsUrl})."
129125
);
130-
}
131126

132127
AddDiagnostic(message);
133128
}

0 commit comments

Comments
 (0)