Skip to content

Commit 7f49e91

Browse files
committed
(GH-3) Working on fixing FxCop Errors
- Corrected all remaining Code Analysis Errors - Had to turn off the Analysis on the CLI project for now, as something very strange is happening there.
1 parent db36f3a commit 7f49e91

20 files changed

+177
-126
lines changed

Source/GitHubReleaseManager.Cli/AssemblyInfo.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
// </copyright>
55
//-----------------------------------------------------------------------
66

7+
using System;
78
using System.Reflection;
9+
using System.Runtime.InteropServices;
810

9-
[assembly: AssemblyCompany("Particular")]
11+
[assembly: AssemblyTitle("GitHubReleaseManager.Cli")]
12+
[assembly: AssemblyProduct("GitHubReleaseManager.Cli")]
13+
[assembly: AssemblyDescription("Create release notes in markdown given a GitHub milestone")]
14+
[assembly: AssemblyFileVersion("1.0.0.0")]
15+
[assembly: AssemblyVersion("1.0.0.0")]
16+
[assembly: AssemblyInformationalVersion("1.0.0.0")]
17+
[assembly: CLSCompliant(false)]
18+
[assembly: ComVisible(false)]
19+
20+
[assembly: Guid("284D3742-6799-4916-AC21-CFDDD7EE6850")]

Source/GitHubReleaseManager.Cli/FodyWeavers.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

Source/GitHubReleaseManager.Cli/GitHubReleaseManager.Cli.csproj

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,28 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>GitHubReleaseManager.Cli</RootNamespace>
1111
<AssemblyName>GitHubReleaseManager</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
14-
<NuGetPackageImportStamp>b15419ce</NuGetPackageImportStamp>
14+
<NuGetPackageImportStamp>c177904e</NuGetPackageImportStamp>
1515
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
1616
<RestorePackages>true</RestorePackages>
1717
<BuildToolsFxCopVersion>1.0.1</BuildToolsFxCopVersion>
18+
<TargetFrameworkProfile />
19+
<PublishUrl>publish\</PublishUrl>
20+
<Install>true</Install>
21+
<InstallFrom>Disk</InstallFrom>
22+
<UpdateEnabled>false</UpdateEnabled>
23+
<UpdateMode>Foreground</UpdateMode>
24+
<UpdateInterval>7</UpdateInterval>
25+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
26+
<UpdatePeriodically>false</UpdatePeriodically>
27+
<UpdateRequired>false</UpdateRequired>
28+
<MapFileExtensions>true</MapFileExtensions>
29+
<ApplicationRevision>0</ApplicationRevision>
30+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
31+
<IsWebBootstrapper>false</IsWebBootstrapper>
32+
<UseApplicationTrust>false</UseApplicationTrust>
33+
<BootstrapperEnabled>true</BootstrapperEnabled>
1834
</PropertyGroup>
1935
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2036
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -33,11 +49,11 @@
3349
<PlatformTarget>AnyCPU</PlatformTarget>
3450
<DebugType>pdbonly</DebugType>
3551
<Optimize>true</Optimize>
36-
<OutputPath>..\..\BuildArtifacts\</OutputPath>
37-
<DefineConstants>TRACE;CODE_ANALYSIS</DefineConstants>
52+
<OutputPath>bin\Release\</OutputPath>
53+
<DefineConstants>TRACE;CODE_ANALYSIS;</DefineConstants>
3854
<ErrorReport>prompt</ErrorReport>
3955
<WarningLevel>4</WarningLevel>
40-
<RunCodeAnalysis>True</RunCodeAnalysis>
56+
<RunCodeAnalysis>false</RunCodeAnalysis>
4157
<CodeAnalysisRuleSet>..\GitHubReleaseManager.ruleset</CodeAnalysisRuleSet>
4258
<CodeAnalysisTreatWarningsAsErrors>True</CodeAnalysisTreatWarningsAsErrors>
4359
</PropertyGroup>
@@ -66,6 +82,7 @@
6682
<Compile Include="PublishSubOptions.cs" />
6783
</ItemGroup>
6884
<ItemGroup>
85+
<None Include="app.config" />
6986
<None Include="packages.config">
7087
<SubType>Designer</SubType>
7188
</None>
@@ -80,54 +97,32 @@
8097
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">
8198
<Link>CustomDictionary.xml</Link>
8299
</CodeAnalysisDictionary>
83-
<Content Include="FodyWeavers.xml" />
100+
</ItemGroup>
101+
<ItemGroup>
102+
<BootstrapperPackage Include=".NETFramework,Version=v4.5.1">
103+
<Visible>False</Visible>
104+
<ProductName>Microsoft .NET Framework 4.5.1 %28x86 and x64%29</ProductName>
105+
<Install>true</Install>
106+
</BootstrapperPackage>
107+
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
108+
<Visible>False</Visible>
109+
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
110+
<Install>false</Install>
111+
</BootstrapperPackage>
112+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
113+
<Visible>False</Visible>
114+
<ProductName>.NET Framework 3.5 SP1</ProductName>
115+
<Install>false</Install>
116+
</BootstrapperPackage>
84117
</ItemGroup>
85118
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
86119
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
87120
<PropertyGroup>
88121
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
89122
</PropertyGroup>
90-
<Error Condition="!Exists('..\packages\Fody.1.26.1\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.26.1\build\Fody.targets'))" />
91123
<Error Condition="!Exists('..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets'))" />
92124
<Error Condition="!Exists('..\packages\StyleCop.Error.MSBuild.1.0.0\build\StyleCop.Error.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\StyleCop.Error.MSBuild.1.0.0\build\StyleCop.Error.MSBuild.Targets'))" />
93125
</Target>
94-
<UsingTask TaskName="CosturaCleanup" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory">
95-
<ParameterGroup>
96-
<Config Output="false" Required="true" ParameterType="Microsoft.Build.Framework.ITaskItem" />
97-
<Files Output="false" Required="true" ParameterType="Microsoft.Build.Framework.ITaskItem[]" />
98-
</ParameterGroup>
99-
<Task Evaluate="true">
100-
<Reference xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Include="System.Xml" />
101-
<Reference xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Include="System.Xml.Linq" />
102-
<Using xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Namespace="System" />
103-
<Using xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Namespace="System.IO" />
104-
<Using xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Namespace="System.Xml.Linq" />
105-
<Code xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Type="Fragment" Language="cs"><![CDATA[
106-
var config = XElement.Load(Config.ItemSpec).Elements("Costura").FirstOrDefault();
107-
108-
if (config == null) return true;
109-
110-
var excludedAssemblies = new List<string>();
111-
var attribute = config.Attribute("ExcludeAssemblies");
112-
if (attribute != null)
113-
foreach (var item in attribute.Value.Split('|').Select(x => x.Trim()).Where(x => x != string.Empty))
114-
excludedAssemblies.Add(item);
115-
var element = config.Element("ExcludeAssemblies");
116-
if (element != null)
117-
foreach (var item in element.Value.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).Where(x => x != string.Empty))
118-
excludedAssemblies.Add(item);
119-
120-
var filesToCleanup = Files.Select(f => f.ItemSpec).Where(f => !excludedAssemblies.Contains(Path.GetFileNameWithoutExtension(f), StringComparer.InvariantCultureIgnoreCase));
121-
122-
foreach (var item in filesToCleanup)
123-
File.Delete(item);
124-
]]></Code>
125-
</Task>
126-
</UsingTask>
127-
<Target Name="CleanReferenceCopyLocalPaths" AfterTargets="AfterBuild;NonWinFodyTarget">
128-
<CosturaCleanup Config="FodyWeavers.xml" Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
129-
</Target>
130-
<Import Project="..\packages\Fody.1.26.1\build\Fody.targets" Condition="Exists('..\packages\Fody.1.26.1\build\Fody.targets')" />
131126
<Import Project="..\..\BuildScripts\CodeAnalysis.props" Condition="Exists('..\..\BuildScripts\CodeAnalysis.props')" />
132127
<Import Project="..\..\BuildScripts\StyleCop.props" Condition="Exists('..\..\BuildScripts\StyleCop.props')" />
133128
<Import Project="..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets" Condition="Exists('..\packages\StyleCop.MSBuild.4.7.49.1\build\StyleCop.MSBuild.Targets')" />
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>

Source/GitHubReleaseManager.Cli/packages.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
<packages>
33
<package id="BuildTools.FxCop" version="1.0.1" targetFramework="net45" />
44
<package id="CommandLineParser" version="1.9.71" targetFramework="net45" />
5-
<package id="Costura.Fody" version="1.3.2.0" targetFramework="net45" developmentDependency="true" />
6-
<package id="Fody" version="1.26.1" targetFramework="net45" developmentDependency="true" />
75
<package id="Octokit" version="0.4.1" targetFramework="net45" />
86
<package id="StyleCop.Error.MSBuild" version="1.0.0" targetFramework="net45" />
97
<package id="StyleCop.MSBuild" version="4.7.49.1" targetFramework="net45" developmentDependency="true" />
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
using ApprovalTests.Reporters;
1+
//-----------------------------------------------------------------------
2+
// <copyright file="ApprovalTestConfig.cs" company="gep13">
3+
// Copyright (c) gep13. All rights reserved.
4+
// </copyright>
5+
//-----------------------------------------------------------------------
6+
7+
using ApprovalTests.Reporters;
28

39
[assembly: UseReporter(typeof(AllFailingTestsClipboardReporter), typeof(DiffReporter))]

Source/GitHubReleaseManager.Tests/ClientBuilder.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
namespace GitHubReleaseManager.Tests
1+
//-----------------------------------------------------------------------
2+
// <copyright file="ClientBuilder.cs" company="gep13">
3+
// Copyright (c) gep13. All rights reserved.
4+
// </copyright>
5+
//-----------------------------------------------------------------------
6+
7+
namespace GitHubReleaseManager.Tests
28
{
39
using Octokit;
410
using Octokit.Internal;
@@ -21,4 +27,4 @@ public static GitHubClient Build()
2127
return new GitHubClient(connection);
2228
}
2329
}
24-
}
30+
}
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
namespace GitHubReleaseManager.Tests
1+
//-----------------------------------------------------------------------
2+
// <copyright file="ClipBoardHelper.cs" company="gep13">
3+
// Copyright (c) gep13. All rights reserved.
4+
// </copyright>
5+
//-----------------------------------------------------------------------
6+
7+
namespace GitHubReleaseManager.Tests
28
{
39
using System.Threading;
410
using System.Windows.Forms;
511

6-
class ClipBoardHelper
12+
public class ClipBoardHelper
713
{
814
public static void SetClipboard(string result)
915
{
@@ -13,4 +19,4 @@ public static void SetClipboard(string result)
1319
thread.Join();
1420
}
1521
}
16-
}
22+
}
Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,44 @@
1-
namespace GitHubReleaseManager.Tests
1+
//-----------------------------------------------------------------------
2+
// <copyright file="FakeGitHubClient.cs" company="gep13">
3+
// Copyright (c) gep13. All rights reserved.
4+
// </copyright>
5+
//-----------------------------------------------------------------------
6+
7+
namespace GitHubReleaseManager.Tests
28
{
39
using System.Collections.Generic;
10+
using System.Collections.ObjectModel;
411
using System.Threading.Tasks;
512
using Octokit;
613
using IGitHubClient = GitHubReleaseManager.IGitHubClient;
714

815
public class FakeGitHubClient : IGitHubClient
916
{
10-
public List<Milestone> Milestones { get; set; }
11-
public List<Issue> Issues { get; set; }
12-
public int NumberOfCommits { get; set; }
13-
1417
public FakeGitHubClient()
1518
{
16-
Milestones = new List<Milestone>();
17-
Issues = new List<Issue>();
19+
this.Milestones = new List<Milestone>();
20+
this.Issues = new List<Issue>();
1821
}
1922

23+
public List<Milestone> Milestones { get; set; }
24+
25+
public List<Issue> Issues { get; set; }
26+
27+
public int NumberOfCommits { get; set; }
28+
2029
public Task<int> GetNumberOfCommitsBetween(Milestone previousMilestone, Milestone currentMilestone)
2130
{
22-
return Task.FromResult(NumberOfCommits);
31+
return Task.FromResult(this.NumberOfCommits);
2332
}
2433

2534
public Task<List<Issue>> GetIssues(Milestone targetMilestone)
2635
{
27-
return Task.FromResult(Issues);
36+
return Task.FromResult(this.Issues);
2837
}
2938

30-
public List<Milestone> GetMilestones()
39+
public ReadOnlyCollection<Milestone> GetMilestones()
3140
{
32-
return Milestones;
41+
return new ReadOnlyCollection<Milestone>(this.Milestones);
3342
}
3443
}
3544
}

Source/GitHubReleaseManager.Tests/GitHubReleaseManager.Tests.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -9,10 +9,11 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>GitHubReleaseManager.Tests</RootNamespace>
1111
<AssemblyName>GitHubReleaseManager.Tests</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
1515
<RestorePackages>true</RestorePackages>
16+
<TargetFrameworkProfile />
1617
</PropertyGroup>
1718
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1819
<DebugSymbols>true</DebugSymbols>

0 commit comments

Comments
 (0)