Skip to content

Commit

Permalink
Merge branch 'release/0.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Aug 20, 2020
2 parents 080737d + d775b31 commit 866a070
Show file tree
Hide file tree
Showing 71 changed files with 7,564 additions and 406 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.cs diff=csharp
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These owners will be the default owners for everything in the repo and
# will be requested for review when someone opens a pull request.
* @pascalberger @christianbumann @x-jokay @silanosa @georgesgoetz
* @cake-contrib/team-bbt @x-jokay
2 changes: 1 addition & 1 deletion nuspec/nuget/Cake.Issues.Testing.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Common helpers for testing add-ins based on Cake.Issues
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.git"/>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues Issues Testing</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/0.8.1</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/0.9.0</releaseNotes>
</metadata>
<files>
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
Expand Down
2 changes: 1 addition & 1 deletion nuspec/nuget/Cake.Issues.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.git"/>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues CodeAnalysis Linting Issues</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/0.8.1</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/0.9.0</releaseNotes>
</metadata>
<files>
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
Expand Down
10 changes: 5 additions & 5 deletions src/Cake.Issues.Testing/BaseIssueProviderFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public abstract class BaseIssueProviderFixture<T>
protected BaseIssueProviderFixture()
{
this.Log = new FakeLog { Verbosity = Verbosity.Normal };
this.RepositorySettings = new RepositorySettings(@"c:\repo");
this.ReadIssuesSettings = new ReadIssuesSettings(@"c:\repo");
}

/// <summary>
Expand All @@ -30,7 +30,7 @@ protected BaseIssueProviderFixture()
/// <summary>
/// Gets or sets the repository settings.
/// </summary>
public RepositorySettings RepositorySettings { get; set; }
public ReadIssuesSettings ReadIssuesSettings { get; set; }

/// <summary>
/// Calls <see cref="BaseIssueProvider.ReadIssues()"/>.
Expand Down Expand Up @@ -67,12 +67,12 @@ private T CreateIssueProvider()
typeof(T),
this.GetCreateIssueProviderArguments().ToArray());

if (this.RepositorySettings == null)
if (this.ReadIssuesSettings == null)
{
throw new InvalidOperationException("No repository settings set.");
throw new InvalidOperationException("No settings for reading issues set.");
}

provider.Initialize(this.RepositorySettings);
provider.Initialize(this.ReadIssuesSettings);
return provider;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Issues.Testing/Cake.Issues.Testing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ItemGroup>
<PackageReference Include="Cake.Core" Version="0.33.0" />
<PackageReference Include="Cake.Testing" Version="0.33.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Issues.Testing/FakeConfigurableIssueProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public FakeConfigurableIssueProvider(
/// <summary>
/// Gets the repository settings.
/// </summary>
public RepositorySettings RepositorySettings => this.Settings;
public IRepositorySettings RepositorySettings => this.Settings;

/// <summary>
/// Gets the issue provider settings.
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Issues.Testing/FakeIssueProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public FakeIssueProvider(ICakeLog log, IEnumerable<IIssue> issues)
/// <summary>
/// Gets the settings.
/// </summary>
public new RepositorySettings Settings => base.Settings;
public new IRepositorySettings Settings => base.Settings;

/// <inheritdoc/>
public override string ProviderName => "Fake Issue Provider";
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Issues.Testing/FakeLogFileFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public FakeLogFileFormat(ICakeLog log, IEnumerable<IIssue> issues)
/// <inheritdoc/>
public override IEnumerable<IIssue> ReadIssues(
FakeMultiFormatIssueProvider issueProvider,
RepositorySettings repositorySettings,
IRepositorySettings repositorySettings,
FakeMultiFormatIssueProviderSettings issueProviderSettings)
{
return this.issues;
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Issues.Testing/FakeMultiFormatIssueProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public FakeMultiFormatIssueProvider(ICakeLog log, FakeMultiFormatIssueProviderSe
/// <summary>
/// Gets the repository settings.
/// </summary>
public RepositorySettings RepositorySettings => this.Settings;
public IRepositorySettings RepositorySettings => this.Settings;

/// <summary>
/// Gets the issue provider settings.
Expand Down
62 changes: 60 additions & 2 deletions src/Cake.Issues.Testing/IssueChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,16 @@ public static void Check(
issueToCheck,
expectedIssue.ProviderType,
expectedIssue.ProviderName,
expectedIssue.Run,
expectedIssue.Identifier,
expectedIssue.ProjectFileRelativePath?.ToString(),
expectedIssue.ProjectName,
expectedIssue.AffectedFileRelativePath?.ToString(),
expectedIssue.Line,
expectedIssue.EndLine,
expectedIssue.Column,
expectedIssue.EndColumn,
expectedIssue.FileLink,
expectedIssue.MessageText,
expectedIssue.MessageHtml,
expectedIssue.MessageMarkdown,
Expand All @@ -60,6 +66,8 @@ public static void Check(
/// <param name="issue">Issue which should be checked.</param>
/// <param name="providerType">Expected type of the issue provider.</param>
/// <param name="providerName">Expected human friendly name of the issue provider.</param>
/// <param name="run">Expected name of the run which reported the issue.</param>
/// <param name="identifier">Expected identifier of the issue.</param>
/// <param name="projectFileRelativePath">Expected relative path of the project file.
/// <c>null</c> if the issue is not expected to be related to a project.</param>
/// <param name="projectName">Expected project name.
Expand All @@ -68,6 +76,14 @@ public static void Check(
/// <c>null</c> if the issue is not expected to be related to a change in a file.</param>
/// <param name="line">Expected line number.
/// <c>null</c> if the issue is not expected to be related to a file or specific line.</param>
/// <param name="endLine">Expected end of line range.
/// <c>null</c> if the issue is not expected to be related to a file, specific line or range of lines.</param>
/// <param name="column">Expected column.
/// <c>null</c> if the issue is not expected to be related to a file or specific column.</param>
/// <param name="endColumn">Expected end of column range.
/// <c>null</c> if the issue is not expected to be related to a file, specific column or range of columns.</param>
/// <param name="fileLink">Expected file link.
/// <c>null</c> if the issue is not expected to have a file link.</param>
/// <param name="messageText">Expected message in plain text format.</param>
/// <param name="messageHtml">Expected message in HTML format.</param>
/// <param name="messageMarkdown">Expected message in Markdown format.</param>
Expand All @@ -83,10 +99,16 @@ public static void Check(
IIssue issue,
string providerType,
string providerName,
string run,
string identifier,
string projectFileRelativePath,
string projectName,
string affectedFileRelativePath,
int? line,
int? endLine,
int? column,
int? endColumn,
Uri fileLink,
string messageText,
string messageHtml,
string messageMarkdown,
Expand All @@ -109,6 +131,18 @@ public static void Check(
$"Expected issue.ProviderName to be '{providerName}' but was '{issue.ProviderName}'.");
}

if (issue.Run != run)
{
throw new Exception(
$"Expected issue.Run to be '{run}' but was '{issue.Run}'.");
}

if (issue.Identifier != identifier)
{
throw new Exception(
$"Expected issue.Identifier to be '{identifier}' but was '{issue.Identifier}'.");
}

if (issue.ProjectFileRelativePath == null)
{
if (projectFileRelativePath != null)
Expand All @@ -122,7 +156,7 @@ public static void Check(
if (issue.ProjectFileRelativePath.ToString() != new FilePath(projectFileRelativePath).ToString())
{
throw new Exception(
$"Expected issue.ProjectFileRelativePath to be '{projectFileRelativePath}' but was '{issue.ProjectFileRelativePath.ToString()}'.");
$"Expected issue.ProjectFileRelativePath to be '{projectFileRelativePath}' but was '{issue.ProjectFileRelativePath}'.");
}

if (!issue.ProjectFileRelativePath.IsRelative)
Expand Down Expand Up @@ -151,7 +185,7 @@ public static void Check(
if (issue.AffectedFileRelativePath.ToString() != new FilePath(affectedFileRelativePath).ToString())
{
throw new Exception(
$"Expected issue.AffectedFileRelativePath to be '{affectedFileRelativePath}' but was '{issue.AffectedFileRelativePath.ToString()}'.");
$"Expected issue.AffectedFileRelativePath to be '{affectedFileRelativePath}' but was '{issue.AffectedFileRelativePath}'.");
}

if (!issue.AffectedFileRelativePath.IsRelative)
Expand All @@ -167,6 +201,30 @@ public static void Check(
$"Expected issue.Line to be '{line}' but was '{issue.Line}'.");
}

if (issue.EndLine != endLine)
{
throw new Exception(
$"Expected issue.EndLine to be '{endLine}' but was '{issue.EndLine}'.");
}

if (issue.Column != column)
{
throw new Exception(
$"Expected issue.Column to be '{column}' but was '{issue.Column}'.");
}

if (issue.EndColumn != endColumn)
{
throw new Exception(
$"Expected issue.EndColumn to be '{endColumn}' but was '{issue.EndColumn}'.");
}

if (issue.FileLink?.ToString() != fileLink?.ToString())
{
throw new Exception(
$"Expected issue.FileLink to be '{fileLink}' but was '{issue.FileLink}'.");
}

if (issue.MessageText != messageText)
{
throw new Exception(
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Issues.Tests/BaseMultiFormatIssueProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void Should_Read_Issues_From_Format()
"Foo".ToByteArray(),
format);
var provider = new FakeMultiFormatIssueProvider(log, settings);
provider.Initialize(new RepositorySettings(@"c:\repo"));
provider.Initialize(new ReadIssuesSettings(@"c:\repo"));

// When
var result = provider.ReadIssues();
Expand Down
10 changes: 8 additions & 2 deletions src/Cake.Issues.Tests/Cake.Issues.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Cake.Core" Version="0.33.0" />
<PackageReference Include="Cake.Testing" Version="0.33.0" />
<PackageReference Include="Shouldly" Version="3.0.2" />
Expand All @@ -34,7 +34,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2" />
</ItemGroup>

<ItemGroup>
Expand All @@ -43,9 +43,15 @@
</ItemGroup>

<ItemGroup>
<None Update="Testfiles\issuesV3.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Testfiles\issuesV2.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Testfiles\issueV3.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Testfiles\issueV2.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Loading

0 comments on commit 866a070

Please sign in to comment.