Skip to content

Commit 7d8173f

Browse files
committed
(maint) removed some warnings.
and pinned gh-actions environment.
1 parent e44a915 commit 7d8173f

File tree

16 files changed

+117
-21
lines changed

16 files changed

+117
-21
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
1414
strategy:
1515
matrix:
16-
os: [windows-latest, ubuntu-latest, macos-latest]
16+
os: [ ubuntu-18.04, windows-2019, macos-10.15 ]
1717

1818
steps:
1919
- uses: actions/checkout@v2.3.4

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
jobs:
1818
analyze:
1919
name: Analyze
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-18.04
2121

2222
strategy:
2323
fail-fast: false
@@ -49,7 +49,7 @@ jobs:
4949
# Prefix the list here with "+" to use these queries and those in the config file.
5050
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5151

52-
- run: ./build.ps1
52+
- run: ./build.ps1 --target=DotNetCore-Build
5353
shell: pwsh
5454

5555
- name: Perform CodeQL Analysis

build.sh

100644100755
File mode changed.

docs/input/guidelines/CakeContribIcon.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Title: CakeContrib-Icon
1111
- [Related rules](#related-rules)
1212
- [Usage](#usage)
1313
- [Settings](#settings)
14-
- [Icon-Location](#icon-location)
1514
- [Icon include in project](#icon-include-in-project)
1615
- [Migrating from an existing project](#migrating-from-an-existing-project)
1716

src/Guidelines/build/TargetFrameworkVersions.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<!-- All other rules have some "configuration" here, this rules required/suggested targets are hard-coded in the task. Sadly. -->
1515

1616
<TargetFrameworkVersions
17+
ProjectFile="$(MSBuildProjectFullPath)"
1718
References="@(PackageReference)"
1819
TargetFramework="$(TargetFramework)"
1920
TargetFrameworks="$(TargetFrameworks)"

src/Tasks.IntegrationTests/E2eTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ public void PackageIcon_Tag_with_wrong_extension_and_custom_Icon_include_results
112112
var result = fixture.Run();
113113

114114
// then
115-
result.IsErrorExitCode.Should().BeTrue();
116-
result.ErrorLines.Should().Contain(l => l.IndexOf("CCG0003", StringComparison.Ordinal) > -1);
115+
result.IsErrorExitCode.Should().BeFalse();
116+
result.WarningLines.Should().Contain(l => l.IndexOf("CCG0003", StringComparison.Ordinal) > -1);
117117
}
118118

119119
[Fact]

src/Tasks.Tests/EnsureCakeContribIconTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.IO;
12
using System.Linq;
23

34
using CakeContrib.Guidelines.Tasks.Tests.Fixtures;
@@ -28,7 +29,7 @@ public void Should_Output_DefaultPackageIcon_If_None_Is_Specified()
2829
public void Should_Output_PackageIcon_If_One_Is_Specified()
2930
{
3031
// given
31-
const string iconPath = "some/cool-icon.png";
32+
var iconPath = Path.Combine("some", "cool-icon.png");
3233
var fixture = new EnsureCakeContribIconFixture();
3334
fixture.WithPackageIcon(iconPath);
3435

@@ -260,7 +261,6 @@ public void Should_Log_Correct_ErrorSourceFile_On_Error_With_Given_ProjectFile()
260261
public void Should_Warn_CCG0003_On_Omit_Set_But_Wrong_Icon()
261262
{
262263
// given
263-
const string projectFileName = "some.project.csproj";
264264
var fixture = new EnsureCakeContribIconFixture();
265265
fixture.WithPackageIcon("foo.png");
266266
fixture.WithIconFileReference("foo.png", "");
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// unset
2+
3+
using System;
4+
using System.Collections.Generic;
5+
using System.IO;
6+
7+
using CakeContrib.Guidelines.Tasks.Extensions;
8+
9+
using FluentAssertions;
10+
11+
using Xunit;
12+
13+
namespace CakeContrib.Guidelines.Tasks.Tests.Extensions
14+
{
15+
public class StringExtensionTests
16+
{
17+
[Theory]
18+
[MemberData(nameof(NormalizePathSeparatorsData))]
19+
public void NormalizePathSeparators(string actual, string expected)
20+
{
21+
// This is not a good tests, as the outcome
22+
// will be different on different OS.
23+
actual.NormalizePathSeparators().Should().Be(expected);
24+
}
25+
26+
public static IEnumerable<object[]> NormalizePathSeparatorsData()
27+
{
28+
yield return new object[] { "Foo/Bar\\baz", Path.Combine("Foo", "Bar", "baz") };
29+
yield return new object[] { "C:\\Foo\\Bar/baz.txt", Path.Combine($"C:{Path.DirectorySeparatorChar}Foo", "Bar", "baz.txt") };
30+
}
31+
}
32+
}

src/Tasks/CcgLogError.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using CakeContrib.Guidelines.Tasks.Extensions;
22

3+
using JetBrains.Annotations;
4+
35
using Microsoft.Build.Framework;
46
using Microsoft.Build.Utilities;
57

@@ -9,6 +11,7 @@ namespace CakeContrib.Guidelines.Tasks
911
/// <summary>
1012
/// This is a convenience-Task to call CcgError from inside the msbuild.
1113
/// </summary>
14+
[UsedImplicitly]
1215
public class CcgLogError : Task
1316
{
1417
/// <summary>

src/Tasks/CcgLogWarning.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using CakeContrib.Guidelines.Tasks.Extensions;
22

3+
using JetBrains.Annotations;
4+
35
using Microsoft.Build.Framework;
46
using Microsoft.Build.Utilities;
57

@@ -9,6 +11,7 @@ namespace CakeContrib.Guidelines.Tasks
911
/// <summary>
1012
/// This is a convenience-Task to call CcgWarning from inside the msbuild.
1113
/// </summary>
14+
[UsedImplicitly]
1215
public class CcgLogWarning : Task
1316
{
1417
/// <summary>

0 commit comments

Comments
 (0)