Skip to content

Commit 5750125

Browse files
authored
Put concatenated strings in parentheses (#36756)
- follow-up to 779db7f - errors occur but point to the `+` sign instead of displaying real problem
1 parent da06d1b commit 5750125

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

eng/scripts/CodeCheck.ps1

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ try {
7474
$fileName = [io.path]::GetFileNameWithoutExtension($_)
7575
if (-not ($projectFileNames.Add($fileName))) {
7676
LogError -code 'BUILD003' -filepath $_ `
77-
"Multiple project files named '$fileName' exist. Project files should have a unique name " +
78-
"to avoid conflicts in build output."
77+
("Multiple project files named '$fileName' exist. Project files should have a unique name " +
78+
"to avoid conflicts in build output.")
7979
}
8080
}
8181

@@ -104,8 +104,8 @@ try {
104104

105105
if ($expectedVersion -ne $actualVersion) {
106106
LogError -filepath "$repoRoot\global.json" `
107-
"MSBuild SDK version '$($dep.Name)' in global.json does not match the value in " +
108-
"Version.Details.xml. Expected '$expectedVersion', actual '$actualVersion'"
107+
("MSBuild SDK version '$($dep.Name)' in global.json does not match the value in " +
108+
"Version.Details.xml. Expected '$expectedVersion', actual '$actualVersion'")
109109
}
110110
}
111111
else {
@@ -124,17 +124,17 @@ try {
124124

125125
if ($expectedVersion -ne $actualVersion) {
126126
LogError -filepath "$repoRoot\eng\Versions.props" `
127-
"Version variable '$varName' does not match the value in Version.Details.xml. " +
128-
"Expected '$expectedVersion', actual '$actualVersion'"
127+
("Version variable '$varName' does not match the value in Version.Details.xml. " +
128+
"Expected '$expectedVersion', actual '$actualVersion'")
129129
}
130130
}
131131
}
132132

133133
foreach ($unexpectedVar in $versionVars) {
134134
LogError -Filepath "$repoRoot\eng\Versions.props" `
135-
"Version variable '$unexpectedVar' does not have a matching entry in Version.Details.xml. " +
136-
"See https://github.com/dotnet/aspnetcore/blob/main/docs/ReferenceResolution.md for instructions " +
137-
"on how to add a new dependency."
135+
("Version variable '$unexpectedVar' does not have a matching entry in Version.Details.xml. " +
136+
"See https://github.com/dotnet/aspnetcore/blob/main/docs/ReferenceResolution.md for instructions " +
137+
"on how to add a new dependency.")
138138
}
139139

140140
# ComponentsWebAssembly-CSharp.sln is used by the templating engine; MessagePack.sln is irrelevant (in submodule).
@@ -198,8 +198,8 @@ try {
198198
if ($changedFilesExclusions -contains $file) {continue}
199199
$filePath = Resolve-Path "${repoRoot}/${file}"
200200
LogError -filepath $filePath `
201-
"Generated code is not up to date in $file. You might need to regenerate the reference " +
202-
"assemblies or project list (see docs/ReferenceResolution.md)"
201+
("Generated code is not up to date in $file. You might need to regenerate the reference " +
202+
"assemblies or project list (see docs/ReferenceResolution.md)")
203203
& git --no-pager diff --ignore-space-change $filePath
204204
}
205205
}
@@ -235,8 +235,8 @@ try {
235235
Write-Host "Found changes in $($changedAPIBaselines.count) API baseline files"
236236

237237
if ($changedAPIBaselines.count -gt 0) {
238-
LogError "Detected modification to baseline API files. PublicAPI.Shipped.txt files should only " +
239-
"be updated after a major release. See /docs/APIBaselines.md for more information."
238+
LogError ("Detected modification to baseline API files. PublicAPI.Shipped.txt files should only " +
239+
"be updated after a major release. See /docs/APIBaselines.md for more information.")
240240
LogError "Modified API baseline files:"
241241
foreach ($file in $changedAPIBaselines) {
242242
LogError $file

0 commit comments

Comments
 (0)