Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Add missing string split options #661

Merged
merged 2 commits into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Only windows is possible until supported cake version
# is bumped to 0.37.0.0+.
# See https://github.com/cake-build/cake/issues/2695
os: [windows-latest]
os: [windows-latest, ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v2.2.0
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
"vstest",
"wixproj",
"xbuild"
]
],
"powershell.codeFormatting.addWhitespaceAroundPipe": true
}
2 changes: 1 addition & 1 deletion Cake.Recipe/Content/buildPlatform.cake
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public class LinuxBuildPlatform : BuildPlatform

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

Expand Down
2 changes: 1 addition & 1 deletion Cake.Recipe/Content/email.cake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public void SendEmail(string subject, string message, string recipient, string s

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

Expand Down
6 changes: 3 additions & 3 deletions Cake.Recipe/Content/testing.cake
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ BuildParameters.Tasks.DotNetCoreTestTask = Task("DotNetCore-Test")
// It is problematic to merge the reports into one, as such we use a custom directory for coverage results
CoverletOutputDirectory = BuildParameters.Paths.Directories.TestCoverage.Combine("coverlet"),
CoverletOutputFormat = CoverletOutputFormat.opencover,
ExcludeByFile = ToolSettings.TestCoverageExcludeByFile.Split(';').ToList(),
ExcludeByAttribute = ToolSettings.TestCoverageExcludeByAttribute.Split(';').ToList()
ExcludeByFile = ToolSettings.TestCoverageExcludeByFile.Split(new [] {';' }, StringSplitOptions.None).ToList(),
ExcludeByAttribute = ToolSettings.TestCoverageExcludeByAttribute.Split(new [] {';' }, StringSplitOptions.None).ToList()
};

foreach (var filter in ToolSettings.TestCoverageFilter.Split(' '))
foreach (var filter in ToolSettings.TestCoverageFilter.Split(new [] {' ' }, StringSplitOptions.None))
{
if (filter[0] == '+')
{
Expand Down