Skip to content

Commit 634d889

Browse files
committed
Enable StyleCop Analyzers
1 parent d5f2024 commit 634d889

File tree

6 files changed

+46
-9
lines changed

6 files changed

+46
-9
lines changed

MouseFastScroll.ruleset

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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.CodeAnalysis.CSharp" RuleNamespace="Microsoft.CodeAnalysis.CSharp">
4+
<Rule Id="CS1573" Action="Hidden" />
5+
<Rule Id="CS1591" Action="Hidden" />
6+
<Rule Id="CS1712" Action="Hidden" />
7+
</Rules>
8+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
9+
<Rule Id="SA1101" Action="None" />
10+
<Rule Id="SA1305" Action="Warning" />
11+
<Rule Id="SA1412" Action="Warning" />
12+
<Rule Id="SA1600" Action="None" />
13+
<Rule Id="SA1609" Action="Warning" />
14+
<Rule Id="SX1101" Action="Warning" />
15+
</Rules>
16+
</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)