Skip to content

Commit c3c4827

Browse files
authored
Merge pull request #661 from AdmiringWorm/ignore-empty-splits
(maint) Add missing string split options
2 parents 0982778 + 6109c55 commit c3c4827

5 files changed

Lines changed: 8 additions & 10 deletions

File tree

.github/workflows/build.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ jobs:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10-
# Only windows is possible until supported cake version
11-
# is bumped to 0.37.0.0+.
12-
# See https://github.com/cake-build/cake/issues/2695
13-
os: [windows-latest]
10+
os: [windows-latest, ubuntu-latest, macos-latest]
1411

1512
steps:
1613
- uses: actions/[email protected]

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@
3939
"vstest",
4040
"wixproj",
4141
"xbuild"
42-
]
42+
],
43+
"powershell.codeFormatting.addWhitespaceAroundPipe": true
4344
}

Cake.Recipe/Content/buildPlatform.cake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public class LinuxBuildPlatform : BuildPlatform
203203

204204
var lines = System.IO.File.ReadAllLines(file);
205205
var details = lines.Where(l => !string.IsNullOrEmpty(l))
206-
.Select(l => l.Split('='))
206+
.Select(l => l.Split(new [] {'=' }, StringSplitOptions.None))
207207
.Where(s => s.Length == 2)
208208
.ToDictionary(s => s[0].ToUpperInvariant(), s => s[1]);
209209

Cake.Recipe/Content/email.cake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public void SendEmail(string subject, string message, string recipient, string s
1010

1111
// The recipient parameter can contain a single email address or a comma/semi-colon separated list of email addresses
1212
var recipients = recipient
13-
.Split(new[] { ',', ';' })
13+
.Split(new[] { ',', ';' }, StringSplitOptions.None)
1414
.Select(emailAddress => new MailAddress(emailAddress))
1515
.ToArray();
1616

Cake.Recipe/Content/testing.cake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ BuildParameters.Tasks.DotNetCoreTestTask = Task("DotNetCore-Test")
119119
// It is problematic to merge the reports into one, as such we use a custom directory for coverage results
120120
CoverletOutputDirectory = BuildParameters.Paths.Directories.TestCoverage.Combine("coverlet"),
121121
CoverletOutputFormat = CoverletOutputFormat.opencover,
122-
ExcludeByFile = ToolSettings.TestCoverageExcludeByFile.Split(';').ToList(),
123-
ExcludeByAttribute = ToolSettings.TestCoverageExcludeByAttribute.Split(';').ToList()
122+
ExcludeByFile = ToolSettings.TestCoverageExcludeByFile.Split(new [] {';' }, StringSplitOptions.None).ToList(),
123+
ExcludeByAttribute = ToolSettings.TestCoverageExcludeByAttribute.Split(new [] {';' }, StringSplitOptions.None).ToList()
124124
};
125125

126-
foreach (var filter in ToolSettings.TestCoverageFilter.Split(' '))
126+
foreach (var filter in ToolSettings.TestCoverageFilter.Split(new [] {' ' }, StringSplitOptions.None))
127127
{
128128
if (filter[0] == '+')
129129
{

0 commit comments

Comments
 (0)