Skip to content

Commit 9f2c39c

Browse files
authored
Merge pull request #16 from sharwell/stylecop-analyzers
Enable StyleCop Analyzers
2 parents d5f2024 + d02d25a commit 9f2c39c

File tree

6 files changed

+110
-9
lines changed

6 files changed

+110
-9
lines changed

MouseFastScroll.ruleset

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RuleSet Name="Rules for StyleCop.Analyzers" Description="Code analysis rules for StyleCop.Analyzers.csproj." ToolsVersion="15.0">
3+
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
4+
<Rule Id="CA1001" Action="Warning" />
5+
<Rule Id="CA1009" Action="Warning" />
6+
<Rule Id="CA1016" Action="Warning" />
7+
<Rule Id="CA1033" Action="Warning" />
8+
<Rule Id="CA1049" Action="Warning" />
9+
<Rule Id="CA1060" Action="Warning" />
10+
<Rule Id="CA1061" Action="Warning" />
11+
<Rule Id="CA1063" Action="Warning" />
12+
<Rule Id="CA1065" Action="Warning" />
13+
<Rule Id="CA1301" Action="Warning" />
14+
<Rule Id="CA1400" Action="Warning" />
15+
<Rule Id="CA1401" Action="Warning" />
16+
<Rule Id="CA1403" Action="Warning" />
17+
<Rule Id="CA1404" Action="Warning" />
18+
<Rule Id="CA1405" Action="Warning" />
19+
<Rule Id="CA1410" Action="Warning" />
20+
<Rule Id="CA1415" Action="Warning" />
21+
<Rule Id="CA1821" Action="Warning" />
22+
<Rule Id="CA1900" Action="Warning" />
23+
<Rule Id="CA1901" Action="Warning" />
24+
<Rule Id="CA2002" Action="Warning" />
25+
<Rule Id="CA2100" Action="Warning" />
26+
<Rule Id="CA2101" Action="Warning" />
27+
<Rule Id="CA2108" Action="Warning" />
28+
<Rule Id="CA2111" Action="Warning" />
29+
<Rule Id="CA2112" Action="Warning" />
30+
<Rule Id="CA2114" Action="Warning" />
31+
<Rule Id="CA2116" Action="Warning" />
32+
<Rule Id="CA2117" Action="Warning" />
33+
<Rule Id="CA2122" Action="Warning" />
34+
<Rule Id="CA2123" Action="Warning" />
35+
<Rule Id="CA2124" Action="Warning" />
36+
<Rule Id="CA2126" Action="Warning" />
37+
<Rule Id="CA2131" Action="Warning" />
38+
<Rule Id="CA2132" Action="Warning" />
39+
<Rule Id="CA2133" Action="Warning" />
40+
<Rule Id="CA2134" Action="Warning" />
41+
<Rule Id="CA2137" Action="Warning" />
42+
<Rule Id="CA2138" Action="Warning" />
43+
<Rule Id="CA2140" Action="Warning" />
44+
<Rule Id="CA2141" Action="Warning" />
45+
<Rule Id="CA2146" Action="Warning" />
46+
<Rule Id="CA2147" Action="Warning" />
47+
<Rule Id="CA2149" Action="Warning" />
48+
<Rule Id="CA2200" Action="Warning" />
49+
<Rule Id="CA2202" Action="Warning" />
50+
<Rule Id="CA2207" Action="Warning" />
51+
<Rule Id="CA2212" Action="Warning" />
52+
<Rule Id="CA2213" Action="Warning" />
53+
<Rule Id="CA2214" Action="Warning" />
54+
<Rule Id="CA2216" Action="Warning" />
55+
<Rule Id="CA2220" Action="Warning" />
56+
<Rule Id="CA2229" Action="Warning" />
57+
<Rule Id="CA2231" Action="Warning" />
58+
<Rule Id="CA2232" Action="Warning" />
59+
<Rule Id="CA2235" Action="Warning" />
60+
<Rule Id="CA2236" Action="Warning" />
61+
<Rule Id="CA2237" Action="Warning" />
62+
<Rule Id="CA2238" Action="Warning" />
63+
<Rule Id="CA2240" Action="Warning" />
64+
<Rule Id="CA2241" Action="Warning" />
65+
<Rule Id="CA2242" Action="Warning" />
66+
</Rules>
67+
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp" RuleNamespace="Microsoft.CodeAnalysis.CSharp">
68+
<Rule Id="CS1573" Action="Hidden" />
69+
<Rule Id="CS1591" Action="Hidden" />
70+
<Rule Id="CS1712" Action="Hidden" />
71+
</Rules>
72+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
73+
<Rule Id="SA1101" Action="None" />
74+
<Rule Id="SA1305" Action="Warning" />
75+
<Rule Id="SA1412" Action="Warning" />
76+
<Rule Id="SA1600" Action="None" />
77+
<Rule Id="SA1609" Action="Warning" />
78+
<Rule Id="SX1101" Action="Warning" />
79+
</Rules>
80+
</RuleSet>

Tvl.VisualStudio.MouseFastScroll/FastScrollProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ internal class FastScrollProvider : IMouseProcessorProvider
1717
public IMouseProcessor GetAssociatedProcessor(IWpfTextView wpfTextView)
1818
{
1919
if (wpfTextView == null)
20+
{
2021
return null;
22+
}
2123

2224
wpfTextView.Options.SetOptionValue(DefaultWpfViewOptions.EnableMouseWheelZoomId, false);
2325
return new FastScrollProcessor(wpfTextView);

Tvl.VisualStudio.MouseFastScroll/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
using System;
55
using System.Runtime.InteropServices;
66

7-
// General Information about an assembly is controlled through the following
7+
// General Information about an assembly is controlled through the following
88
// set of attributes. Change these attribute values to modify the information
99
// associated with an assembly.
1010
[assembly: CLSCompliant(false)]
1111

12-
// Setting ComVisible to false makes the types in this assembly not visible
13-
// to COM components. If you need to access a type in this assembly from
12+
// Setting ComVisible to false makes the types in this assembly not visible
13+
// to COM components. If you need to access a type in this assembly from
1414
// COM, set the ComVisible attribute to true on that type.
1515
[assembly: ComVisible(false)]

Tvl.VisualStudio.MouseFastScroll/StyleCop.Cache

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

Tvl.VisualStudio.MouseFastScroll/Tvl.VisualStudio.MouseFastScroll.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
<PropertyGroup>
66
<TargetFramework>net45</TargetFramework>
7+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
8+
<CodeAnalysisRuleSet>..\MouseFastScroll.ruleset</CodeAnalysisRuleSet>
79

810
<Description>Mouse Fast Scroll extension for Visual Studio</Description>
911
<Company>Tunnel Vision Laboratories, LLC</Company>
@@ -35,6 +37,7 @@
3537

3638
<ItemGroup>
3739
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="15.1.192" PrivateAssets="all" />
40+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta006" PrivateAssets="all" />
3841
<PackageReference Include="VSSDK.CoreUtility" Version="11.0.4" />
3942
<PackageReference Include="VSSDK.Text" Version="11.0.4" />
4043
</ItemGroup>
@@ -46,6 +49,14 @@
4649
</Content>
4750
</ItemGroup>
4851

52+
<ItemGroup>
53+
<AdditionalFiles Include="..\stylecop.json" Link="stylecop.json" />
54+
</ItemGroup>
55+
56+
<ItemGroup>
57+
<None Include="$(CodeAnalysisRuleSet)" Condition="'$(CodeAnalysisRuleSet)' != ''" Link="%(Filename)%(Extension)" />
58+
</ItemGroup>
59+
4960
<PropertyGroup>
5061
<SignAssembly>true</SignAssembly>
5162
<AssemblyOriginatorKeyFile>SharedKey.snk</AssemblyOriginatorKeyFile>

stylecop.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
3+
"settings": {
4+
"documentationRules": {
5+
"companyName": "Tunnel Vision Laboratories, LLC",
6+
"copyrightText": "Copyright (c) {companyName}. All Rights Reserved.\nLicensed under the Apache License, Version 2.0. See LICENSE.txt in the project root for license information.",
7+
"xmlHeader": false,
8+
"fileNamingConvention": "metadata"
9+
},
10+
"layoutRules": {
11+
"newlineAtEndOfFile": "require"
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)