Skip to content
This repository was archived by the owner on Apr 6, 2024. It is now read-only.

Commit 69a8dfb

Browse files
committed
Merge branch 'release/0.8.0'
2 parents 0964b77 + 60d1d27 commit 69a8dfb

11 files changed

Lines changed: 37 additions & 66 deletions

File tree

.appveyor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ image: Visual Studio 2017
66
#---------------------------------#
77
# Build Script #
88
#---------------------------------#
9+
install:
10+
# Update to latest NuGet version since we require 5.3.0 for embedded icon
11+
- ps: nuget update -self
12+
913
build_script:
1014
- ps: .\build.ps1 -Target AppVeyor
1115

azure-pipelines.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ trigger:
66

77
pr:
88
- develop
9+
- release/*
10+
- hotfix/*
911

1012
jobs:
1113
- job: Windows

docs/features.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,8 @@ The [Cake.Issues.GitRepository addin] provides the following features.
77

88
# Basic features
99

10-
* Checks if binary files are tracked by Git LFS.
11-
12-
# Supported comment formats
13-
14-
| | Comment format | Remarks |
15-
|--------------------------------------------------------------------|--------------------------------|--------------------------------|
16-
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IssueCommentFormat.PlainText` | |
17-
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IssueCommentFormat.Markdown` | |
18-
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IssueCommentFormat.Html` | |
10+
* Checks path length of files. See [FilePathTooLong] for details.
11+
* Checks if binary files are tracked by Git LFS. See [BinaryFileNotTrackedByLfs] for details.
1912

2013
# Supported IIssue properties
2114

@@ -27,10 +20,14 @@ The [Cake.Issues.GitRepository addin] provides the following features.
2720
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.ProjectFileRelativePath` | |
2821
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.AffectedFileRelativePath` | |
2922
| <span class="glyphicon glyphicon-remove" style="color:red"></span> | `IIssue.Line` | |
30-
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.Message` | |
23+
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.MessageText` | |
24+
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.MessageHtml` | |
25+
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.MessageMarkdown` | |
3126
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.Priority` | |
3227
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.PriorityName` | |
3328
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.Rule` | |
3429
| <span class="glyphicon glyphicon-ok" style="color:green"></span> | `IIssue.RuleUrl` | |
3530

3631
[Cake.Issues.GitRepository addin]: https://www.nuget.org/packages/Cake.Issues.GitRepository
32+
[FilePathTooLong]: rules/FilePathTooLong
33+
[BinaryFileNotTrackedByLfs]: rules/BinaryFileNotTrackedByLfs

docs/rules/BinaryFileNotTrackedByLfs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Description: A binary file is not tracked by Git LFS.
77
<?*
88
"Rule Id" BinaryFileNotTrackedByLfs
99
Priority Warning
10+
"Available in" "0.7.0 or higher"
1011
?>
1112
<?#/ Table ?>
1213

docs/rules/FilePathTooLong.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Description: The path of a file is too long.
77
<?*
88
"Rule Id" FilePathTooLong
99
Priority Warning
10+
"Available in" "0.7.3 or higher"
1011
?>
1112
<?#/ Table ?>
1213

nuspec/nuget/Cake.Issues.GitRepository.nuspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
1919
</description>
2020
<license type="expression">MIT</license>
2121
<projectUrl>https://cakeissues.net</projectUrl>
22-
<iconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics@a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png</iconUrl>
22+
<icon>icon.png</icon>
2323
<requireLicenseAcceptance>false</requireLicenseAcceptance>
2424
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.GitRepository.git"/>
2525
<copyright>Copyright © Pascal Berger</copyright>
2626
<tags>Cake Script Cake-Issues Cake-IssueProvider CodeAnalysis Linting Git</tags>
27-
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.GitRepository/releases/tag/0.7.3</releaseNotes>
27+
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.GitRepository/releases/tag/0.8.0</releaseNotes>
2828
</metadata>
2929
<files>
30+
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
3031
<file src="netstandard2.0/Cake.Issues.GitRepository.dll" target="lib\netstandard2.0" />
3132
<file src="netstandard2.0/Cake.Issues.GitRepository.pdb" target="lib\netstandard2.0" />
3233
<file src="netstandard2.0/Cake.Issues.GitRepository.xml" target="lib\netstandard2.0" />

nuspec/nuget/icon.png

15.2 KB
Loading

src/Cake.Issues.GitRepository.Tests/Cake.Issues.GitRepository.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
</ItemGroup>
2424
<ItemGroup>
2525
<PackageReference Include="Cake.Issues">
26-
<Version>0.7.0</Version>
26+
<Version>0.8.0</Version>
2727
</PackageReference>
2828
<PackageReference Include="Cake.Issues.Testing">
29-
<Version>0.7.0</Version>
29+
<Version>0.8.0</Version>
3030
</PackageReference>
3131
<PackageReference Include="Cake.Testing">
3232
<Version>0.33.0</Version>

src/Cake.Issues.GitRepository/Cake.Issues.GitRepository.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<Version>0.33.0</Version>
3131
</PackageReference>
3232
<PackageReference Include="Cake.Issues">
33-
<Version>0.7.0</Version>
33+
<Version>0.8.0</Version>
3434
</PackageReference>
3535
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
3636
<Version>2.9.6</Version>

src/Cake.Issues.GitRepository/GitRepositoryIssuesProvider.cs

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,18 @@ public GitRepositoryIssuesProvider(
7474
protected GitRepositoryIssuesSettings IssueProviderSettings { get; private set; }
7575

7676
/// <inheritdoc />
77-
protected override IEnumerable<IIssue> InternalReadIssues(IssueCommentFormat format)
77+
protected override IEnumerable<IIssue> InternalReadIssues()
7878
{
7979
var result = new List<IIssue>();
8080

8181
if (this.IssueProviderSettings.CheckBinaryFilesTrackedByLfs)
8282
{
83-
result.AddRange(this.CheckForBinaryFilesNotTrackedByLfs(format));
83+
result.AddRange(this.CheckForBinaryFilesNotTrackedByLfs());
8484
}
8585

8686
if (this.IssueProviderSettings.CheckFilesPathLength)
8787
{
88-
result.AddRange(this.CheckForFilesPathLength(format));
88+
result.AddRange(this.CheckForFilesPathLength());
8989
}
9090

9191
return result;
@@ -94,9 +94,8 @@ protected override IEnumerable<IIssue> InternalReadIssues(IssueCommentFormat for
9494
/// <summary>
9595
/// Checks for binary files which are not tracked by LFS.
9696
/// </summary>
97-
/// <param name="format">Preferred format of the messages.</param>
9897
/// <returns>List of issues for binary files which are not tracked by LFS.</returns>
99-
private IEnumerable<IIssue> CheckForBinaryFilesNotTrackedByLfs(IssueCommentFormat format)
98+
private IEnumerable<IIssue> CheckForBinaryFilesNotTrackedByLfs()
10099
{
101100
if (!this.allFiles.Value.Any())
102101
{
@@ -115,25 +114,13 @@ private IEnumerable<IIssue> CheckForBinaryFilesNotTrackedByLfs(IssueCommentForma
115114
var result = new List<IIssue>();
116115
foreach (var file in binaryFilesNotTrackedByLfs)
117116
{
118-
string message = null;
119-
switch (format)
120-
{
121-
case IssueCommentFormat.Markdown:
122-
message = $"The binary file `{file}` is not tracked by Git LFS";
123-
break;
124-
case IssueCommentFormat.Html:
125-
message = $"The binary file <pre>{file}</pre> is not tracked by Git LFS";
126-
break;
127-
default:
128-
message = $"The binary file \"{file}\" is not tracked by Git LFS";
129-
break;
130-
}
131-
132117
var ruleDescription = new BinaryFileNotTrackedByLfsRuleDescription();
133118

134119
result.Add(
135120
IssueBuilder
136-
.NewIssue(message, this)
121+
.NewIssue($"The binary file \"{file}\" is not tracked by Git LFS", this)
122+
.WithMessageInHtmlFormat($"The binary file <pre>{file}</pre> is not tracked by Git LFS")
123+
.WithMessageInMarkdownFormat($"The binary file `{file}` is not tracked by Git LFS")
137124
.InFile(file)
138125
.OfRule(ruleDescription)
139126
.Create());
@@ -145,9 +132,8 @@ private IEnumerable<IIssue> CheckForBinaryFilesNotTrackedByLfs(IssueCommentForma
145132
/// <summary>
146133
/// Checks for files path length.
147134
/// </summary>
148-
/// <param name="format">Preferred format of the messages.</param>
149135
/// <returns>List of issues for repository files with paths exceeding the allowed maximum.</returns>
150-
private IEnumerable<IIssue> CheckForFilesPathLength(IssueCommentFormat format)
136+
private IEnumerable<IIssue> CheckForFilesPathLength()
151137
{
152138
if (!this.allFiles.Value.Any())
153139
{
@@ -159,28 +145,13 @@ private IEnumerable<IIssue> CheckForFilesPathLength(IssueCommentFormat format)
159145
{
160146
if (file.Length > this.IssueProviderSettings.MaxFilePathLength)
161147
{
162-
string message = null;
163-
switch (format)
164-
{
165-
case IssueCommentFormat.Markdown:
166-
message =
167-
$"The path for the file `{file}` is too long. Maximum allowed path length is {this.IssueProviderSettings.MaxFilePathLength}, actual path length is {file.Length}.";
168-
break;
169-
case IssueCommentFormat.Html:
170-
message =
171-
$"The path for the file <pre>{file}</pre> is too long. Maximum allowed path length is {this.IssueProviderSettings.MaxFilePathLength}, actual path length is {file.Length}.";
172-
break;
173-
default:
174-
message =
175-
$"The path for the file \"{file}\" is too long. Maximum allowed path length is {this.IssueProviderSettings.MaxFilePathLength}, actual path length is {file.Length}.";
176-
break;
177-
}
178-
179148
var ruleDescription = new FilePathTooLongRuleDescription();
180149

181150
result.Add(
182151
IssueBuilder
183-
.NewIssue(message, this)
152+
.NewIssue($"The path for the file \"{file}\" is too long. Maximum allowed path length is {this.IssueProviderSettings.MaxFilePathLength}, actual path length is {file.Length}.", this)
153+
.WithMessageInHtmlFormat($"The path for the file <pre>{file}</pre> is too long. Maximum allowed path length is {this.IssueProviderSettings.MaxFilePathLength}, actual path length is {file.Length}.")
154+
.WithMessageInMarkdownFormat($"The path for the file `{file}` is too long. Maximum allowed path length is {this.IssueProviderSettings.MaxFilePathLength}, actual path length is {file.Length}.")
184155
.InFile(file)
185156
.OfRule(ruleDescription)
186157
.Create());

0 commit comments

Comments
 (0)