This repository was archived by the owner on Apr 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +35
-12
lines changed
src/Cake.Issues.Reporting.Generic Expand file tree Collapse file tree 4 files changed +35
-12
lines changed Original file line number Diff line number Diff line change 73
73
<Compile Include =" GenericIssueReportFormatAliases.cs" />
74
74
<Compile Include =" GenericIssueReportGenerator.cs" />
75
75
<Compile Include =" GenericIssueReportFormatSettings.cs" />
76
+ <Compile Include =" IIssueExtension.cs" />
76
77
<Compile Include =" RazorEngineReferenceResolver.cs" />
77
78
<Compile Include =" GenericIssueReportTemplate.cs" />
78
79
<Compile Include =" GenericIssueReportTemplateExtensions.cs" />
Original file line number Diff line number Diff line change
1
+ namespace Cake . Issues . Reporting . Generic
2
+ {
3
+ using Cake . Core . IO ;
4
+
5
+ /// <summary>
6
+ /// Extension for <see cref="IIssue"/>.
7
+ /// </summary>
8
+ public static class IIssueExtension
9
+ {
10
+ /// <summary>
11
+ /// Returns the path of the <see cref="IIssue.AffectedFileRelativePath"/>.
12
+ /// </summary>
13
+ /// <param name="issue">Issue for which the path should be returned.</param>
14
+ /// <returns>Path of the file affected by the issue.</returns>
15
+ public static string FilePath ( this IIssue issue )
16
+ {
17
+ return issue . AffectedFileRelativePath ? . GetDirectory ( ) . FullPath ;
18
+ }
19
+
20
+ /// <summary>
21
+ /// Returns the name of the file of the <see cref="IIssue.AffectedFileRelativePath"/>.
22
+ /// </summary>
23
+ /// <param name="issue">Issue for which the file name should be returned.</param>
24
+ /// <returns>Name of the file affected by the issue.</returns>
25
+ public static string FileName ( this IIssue issue )
26
+ {
27
+ return issue . AffectedFileRelativePath ? . GetFilename ( ) . ToString ( ) ;
28
+ }
29
+ }
30
+ }
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ public IEnumerable<CompilerReference> GetReferences(
31
31
yield return CompilerReference . From ( this . FindLoaded ( loadedAssemblies , "Newtonsoft.Json.dll" ) ) ;
32
32
yield return CompilerReference . From ( this . FindLoaded ( loadedAssemblies , "Cake.Core.dll" ) ) ;
33
33
yield return CompilerReference . From ( this . FindLoaded ( loadedAssemblies , "Cake.Issues.dll" ) ) ;
34
+ yield return CompilerReference . From ( this . FindLoaded ( loadedAssemblies , "Cake.Issues.Reporting.Generic.dll" ) ) ;
34
35
yield return CompilerReference . From ( typeof ( RazorEngine . Engine ) . Assembly ) ;
35
36
}
36
37
Original file line number Diff line number Diff line change 1
1
@model IEnumerable <Cake .Issues .IIssue >
2
+ @using Cake .Issues .Reporting .Generic
2
3
3
4
<!DOCTYPE html>
4
5
77
78
<tr >
78
79
<td >@issue.PriorityName </td >
79
80
<td >@issue.Project </td >
80
- <td >
81
- @if (issue .AffectedFileRelativePath != null )
82
- {
83
- @issue.AffectedFileRelativePath.GetDirectory()
84
- }
85
- </td >
86
- <td >
87
- @if (issue .AffectedFileRelativePath != null )
88
- {
89
- @issue.AffectedFileRelativePath.GetFilename()
90
- }
91
- </td >
81
+ <td >@issue.FilePath() </td >
82
+ <td >@issue.FileName() </td >
92
83
<td >@issue.Line </td >
93
84
<td >
94
85
@if (issue .RuleUrl != null )
You can’t perform that action at this time.
0 commit comments