Skip to content
This repository was archived by the owner on Feb 12, 2023. It is now read-only.

Commit 49d61ca

Browse files
committed
Apply StyleCop.Analyzers and fix issues
Some issues are suppressed to fix later.
1 parent e8c31a9 commit 49d61ca

39 files changed

+292
-107
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ sql
107107
TestResults
108108
*.Cache
109109
ClientBin
110-
stylecop.*
111110
~$*
112111
*.dbmdl
113112
Generated_Code #added for RIA/Silverlight projects

src/GitLink/Exceptions/GitLinkException.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright file="GitLinkException.cs" company="CatenaLogic">
3-
// Copyright (c) 2014 - 2014 CatenaLogic. All rights reserved.
3+
// Copyright (c) 2014 - 2016 CatenaLogic. All rights reserved.
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

7-
87
namespace GitLink
98
{
109
using System;

src/GitLink/Extensions/BinaryReaderExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright file="BinaryReaderExtensions.cs" company="CatenaLogic">
3-
// Copyright (c) 2014 - 2014 CatenaLogic. All rights reserved.
3+
// Copyright (c) 2014 - 2016 CatenaLogic. All rights reserved.
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

7-
87
namespace GitLink
98
{
109
using System;

src/GitLink/Extensions/PdbExtensions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright file="PdbExtensions.cs" company="CatenaLogic">
3-
// Copyright (c) 2014 - 2014 CatenaLogic. All rights reserved.
3+
// Copyright (c) 2014 - 2016 CatenaLogic. All rights reserved.
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

7-
87
namespace GitLink
98
{
109
using System;
@@ -39,7 +38,7 @@ public static IReadOnlyDictionary<string, byte[]> GetFilesAndChecksums(this PdbF
3938
{
4039
Argument.IsNotNull(() => pdbFile);
4140

42-
//const int LastInterestingByte = 47;
41+
// const int LastInterestingByte = 47;
4342
const string FileIndicator = "/src/files/";
4443

4544
var values = pdbFile.Info.NameToPdbName.Values;

src/GitLink/Extensions/RepositoryExtensions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
namespace GitLink
1+
// <copyright file="RepositoryExtensions.cs" company="CatenaLogic">
2+
// Copyright (c) 2014 - 2016 CatenaLogic. All rights reserved.
3+
// </copyright>
4+
5+
namespace GitLink
26
{
37
using System;
48
using System.Collections.Generic;

src/GitLink/Extensions/StringExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright file="StringExtensions.cs" company="CatenaLogic">
3-
// Copyright (c) 2014 - 2014 CatenaLogic. All rights reserved.
3+
// Copyright (c) 2014 - 2016 CatenaLogic. All rights reserved.
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

7-
87
namespace GitLink
98
{
109
using Catel;

src/GitLink/GitLink.csproj

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
<WarningLevel>4</WarningLevel>
2424
<Prefer32Bit>false</Prefer32Bit>
2525
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
26-
<DocumentationFile>
27-
</DocumentationFile>
26+
<DocumentationFile>..\..\bin\Debug\GitLink\GitLink.XML</DocumentationFile>
27+
<CodeAnalysisRuleSet>GitLink.ruleset</CodeAnalysisRuleSet>
28+
<NoWarn>CS1591</NoWarn>
2829
</PropertyGroup>
2930
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3031
<DebugType>pdbonly</DebugType>
@@ -35,8 +36,9 @@
3536
<WarningLevel>4</WarningLevel>
3637
<Prefer32Bit>false</Prefer32Bit>
3738
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
38-
<DocumentationFile>
39-
</DocumentationFile>
39+
<DocumentationFile>..\..\bin\Release\GitLink\GitLink.XML</DocumentationFile>
40+
<CodeAnalysisRuleSet>GitLink.ruleset</CodeAnalysisRuleSet>
41+
<NoWarn>CS1591</NoWarn>
4042
</PropertyGroup>
4143
<PropertyGroup>
4244
<StartupObject>GitLink.Program</StartupObject>
@@ -88,19 +90,23 @@
8890
<Compile Include="Providers\VisualStudioTeamServicesProvider.cs" />
8991
</ItemGroup>
9092
<ItemGroup>
93+
<None Include="GitLink.ruleset" />
9194
<None Include="pdbstr.exe">
9295
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
9396
</None>
9497
<None Include="winsdk.redist.txt">
9598
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
9699
</None>
97-
<Content Include="Logo.ico" />
100+
<None Include="project.json" />
98101
</ItemGroup>
99102
<ItemGroup>
100-
<None Include="project.json" />
103+
<Content Include="Logo.ico" />
101104
</ItemGroup>
102105
<ItemGroup>
103106
<Folder Include="Icons\" />
104107
</ItemGroup>
108+
<ItemGroup>
109+
<AdditionalFiles Include="stylecop.json" />
110+
</ItemGroup>
105111
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
106112
</Project>

src/GitLink/GitLink.ruleset

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="10.0">
3+
<Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized">
4+
<Name Resource="MinimumRecommendedRules_Name" />
5+
<Description Resource="MinimumRecommendedRules_Description" />
6+
</Localization>
7+
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
8+
<Rule Id="CA1001" Action="Warning" />
9+
<Rule Id="CA1009" Action="Warning" />
10+
<Rule Id="CA1016" Action="Warning" />
11+
<Rule Id="CA1033" Action="Warning" />
12+
<Rule Id="CA1049" Action="Warning" />
13+
<Rule Id="CA1060" Action="Warning" />
14+
<Rule Id="CA1061" Action="Warning" />
15+
<Rule Id="CA1063" Action="Warning" />
16+
<Rule Id="CA1065" Action="Warning" />
17+
<Rule Id="CA1301" Action="Warning" />
18+
<Rule Id="CA1400" Action="Warning" />
19+
<Rule Id="CA1401" Action="Warning" />
20+
<Rule Id="CA1403" Action="Warning" />
21+
<Rule Id="CA1404" Action="Warning" />
22+
<Rule Id="CA1405" Action="Warning" />
23+
<Rule Id="CA1410" Action="Warning" />
24+
<Rule Id="CA1415" Action="Warning" />
25+
<Rule Id="CA1821" Action="Warning" />
26+
<Rule Id="CA1900" Action="Warning" />
27+
<Rule Id="CA1901" Action="Warning" />
28+
<Rule Id="CA2002" Action="Warning" />
29+
<Rule Id="CA2100" Action="Warning" />
30+
<Rule Id="CA2101" Action="Warning" />
31+
<Rule Id="CA2108" Action="Warning" />
32+
<Rule Id="CA2111" Action="Warning" />
33+
<Rule Id="CA2112" Action="Warning" />
34+
<Rule Id="CA2114" Action="Warning" />
35+
<Rule Id="CA2116" Action="Warning" />
36+
<Rule Id="CA2117" Action="Warning" />
37+
<Rule Id="CA2122" Action="Warning" />
38+
<Rule Id="CA2123" Action="Warning" />
39+
<Rule Id="CA2124" Action="Warning" />
40+
<Rule Id="CA2126" Action="Warning" />
41+
<Rule Id="CA2131" Action="Warning" />
42+
<Rule Id="CA2132" Action="Warning" />
43+
<Rule Id="CA2133" Action="Warning" />
44+
<Rule Id="CA2134" Action="Warning" />
45+
<Rule Id="CA2137" Action="Warning" />
46+
<Rule Id="CA2138" Action="Warning" />
47+
<Rule Id="CA2140" Action="Warning" />
48+
<Rule Id="CA2141" Action="Warning" />
49+
<Rule Id="CA2146" Action="Warning" />
50+
<Rule Id="CA2147" Action="Warning" />
51+
<Rule Id="CA2149" Action="Warning" />
52+
<Rule Id="CA2200" Action="Warning" />
53+
<Rule Id="CA2202" Action="Warning" />
54+
<Rule Id="CA2207" Action="Warning" />
55+
<Rule Id="CA2212" Action="Warning" />
56+
<Rule Id="CA2213" Action="Warning" />
57+
<Rule Id="CA2214" Action="Warning" />
58+
<Rule Id="CA2216" Action="Warning" />
59+
<Rule Id="CA2220" Action="Warning" />
60+
<Rule Id="CA2229" Action="Warning" />
61+
<Rule Id="CA2231" Action="Warning" />
62+
<Rule Id="CA2232" Action="Warning" />
63+
<Rule Id="CA2235" Action="Warning" />
64+
<Rule Id="CA2236" Action="Warning" />
65+
<Rule Id="CA2237" Action="Warning" />
66+
<Rule Id="CA2238" Action="Warning" />
67+
<Rule Id="CA2240" Action="Warning" />
68+
<Rule Id="CA2241" Action="Warning" />
69+
<Rule Id="CA2242" Action="Warning" />
70+
</Rules>
71+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
72+
<Rule Id="SA1101" Action="Hidden" />
73+
<Rule Id="SA1507" Action="Hidden" />
74+
<Rule Id="SA1202" Action="Hidden" />
75+
<Rule Id="SA1201" Action="Hidden" />
76+
<Rule Id="SA1124" Action="Hidden" />
77+
<Rule Id="SA1309" Action="Hidden" />
78+
<Rule Id="SA1600" Action="Hidden" />
79+
<Rule Id="SA1121" Action="Hidden" />
80+
<Rule Id="SA1214" Action="Hidden" />
81+
<Rule Id="SA1203" Action="Hidden" />
82+
</Rules>
83+
</RuleSet>

src/GitLink/Helpers/PdbStrHelper.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright file="PdbStrHelper.cs" company="CatenaLogic">
3-
// Copyright (c) 2014 - 2014 CatenaLogic. All rights reserved.
3+
// Copyright (c) 2014 - 2016 CatenaLogic. All rights reserved.
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

7-
87
namespace GitLink
98
{
109
using System.Diagnostics;

src/GitLink/LinkMethod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
2-
// <copyright file="Linker.cs" company="Andrew Arnott">
3-
// Copyright (c) 2016 Andrew Arnott. All rights reserved.
2+
// <copyright file="LinkMethod.cs" company="CatenaLogic">
3+
// Copyright (c) 2014 - 2016 CatenaLogic. All rights reserved.
44
// </copyright>
55
// --------------------------------------------------------------------------------------------------------------------
66

0 commit comments

Comments
 (0)