Skip to content

Commit e34815c

Browse files
committed
Merge remote-tracking branch 'DotNetAnalyzers/master' into master
2 parents 28b75f2 + a3f3097 commit e34815c

761 files changed

Lines changed: 29153 additions & 3897 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codecov.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# https://docs.codecov.io/docs/codecov-yaml
2+
# https://github.com/codecov/support/wiki/Codecov-Yaml
3+
4+
coverage:
5+
status:
6+
project:
7+
default: false
8+
patch:
9+
default: false
10+
11+
flags:
12+
production:
13+
paths:
14+
- StyleCop.Analyzers/StyleCop.Analyzers/
15+
- StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/
16+
test:
17+
paths:
18+
- StyleCop.Analyzers/StyleCop.Analyzers.Test/
19+
- StyleCop.Analyzers/StyleCopTester/

.editorconfig

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
root = true
2+
3+
[*.cs]
4+
charset = utf-8-bom
5+
insert_final_newline = true
6+
indent_style = space
7+
indent_size = 4
8+
9+
# Sort using and Import directives with System.* appearing first
10+
dotnet_sort_system_directives_first = true
11+
12+
# Always use "this." and "Me." when applicable; let StyleCop Analyzers provide the warning and fix
13+
dotnet_style_qualification_for_field = true:none
14+
dotnet_style_qualification_for_property = true:none
15+
dotnet_style_qualification_for_method = true:none
16+
dotnet_style_qualification_for_event = true:none
17+
18+
# Use language keywords where applicable; let StyleCop Analyzers provide the warning and fix
19+
dotnet_style_predefined_type_for_locals_parameters_members = true:none
20+
dotnet_style_predefined_type_for_member_access = true:none
21+
22+
# Suggest more modern language features when available
23+
dotnet_style_object_initializer = true:none
24+
dotnet_style_collection_initializer = true:none
25+
dotnet_style_coalesce_expression = true:suggestion
26+
dotnet_style_null_propagation = true:suggestion
27+
dotnet_style_explicit_tuple_names = true:suggestion
28+
29+
# New line preferences
30+
csharp_new_line_before_open_brace = all
31+
csharp_new_line_before_else = true
32+
csharp_new_line_before_catch = true
33+
csharp_new_line_before_finally = true
34+
csharp_new_line_before_members_in_object_initializers = true
35+
csharp_new_line_before_members_in_anonymous_types = true
36+
csharp_new_line_within_query_expression_clauses = true
37+
38+
# Indentation preferences
39+
csharp_indent_block_contents = true
40+
csharp_indent_braces = false
41+
csharp_indent_case_contents = true
42+
csharp_indent_switch_labels = false
43+
csharp_indent_labels = flush_left
44+
45+
# Space preferences
46+
csharp_space_after_cast = false
47+
csharp_space_after_colon_in_inheritance_clause = true
48+
csharp_space_after_comma = true
49+
csharp_space_after_dot = false
50+
csharp_space_after_keywords_in_control_flow_statements = true
51+
csharp_space_after_semicolon_in_for_statement = true
52+
csharp_space_around_binary_operators = before_and_after
53+
csharp_space_around_declaration_statements = do_not_ignore
54+
csharp_space_before_colon_in_inheritance_clause = true
55+
csharp_space_before_comma = false
56+
csharp_space_before_dot = false
57+
csharp_space_before_open_square_brackets = false
58+
csharp_space_before_semicolon_in_for_statement = false
59+
csharp_space_between_empty_square_brackets = false
60+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
61+
csharp_space_between_method_call_name_and_opening_parenthesis = false
62+
csharp_space_between_method_call_parameter_list_parentheses = false
63+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
64+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
65+
csharp_space_between_method_declaration_parameter_list_parentheses = false
66+
csharp_space_between_parentheses = false
67+
csharp_space_between_square_brackets = false
68+
69+
# Prefer "var" only where type is obvious; disable diagnostics since no firm policy is in place yet
70+
csharp_style_var_for_built_in_types = false:none
71+
csharp_style_var_when_type_is_apparent = true:none
72+
csharp_style_var_elsewhere = false:none
73+
74+
# Prefer method-like constructs to have a block body
75+
csharp_style_expression_bodied_methods = false:none
76+
csharp_style_expression_bodied_constructors = false:none
77+
csharp_style_expression_bodied_operators = false:none
78+
79+
# Prefer property-like constructs to have an expression-body
80+
csharp_style_expression_bodied_properties = true:none
81+
csharp_style_expression_bodied_indexers = true:none
82+
csharp_style_expression_bodied_accessors = true:none
83+
84+
# Suggest more modern language features when available
85+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
86+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
87+
csharp_style_inlined_variable_declaration = true:none
88+
csharp_style_throw_expression = true:none
89+
csharp_style_conditional_delegate_call = true:suggestion

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ packages/
1010
*.user
1111
TestResults/
1212
OpenCover.Reports/
13+
OpenCover.Symbols/
1314
.nuget/NuGet.exe
1415
build/nuget/
1516
*.log

.nuget/packages.config

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="NuGet.CommandLine" version="2.8.3" />
4-
<package id="OpenCover" version="4.6.247-rc" />
3+
<package id="Codecov" version="1.0.1" />
4+
<package id="Microsoft.DiaSymReader.Pdb2Pdb" version="1.1.0-beta1-62624-01" />
5+
<package id="OpenCover" version="4.6.519" />
56
<package id="ReportGenerator" version="2.3.5.0" targetFramework="net452" />
67
<package id="xunit.runner.console" version="2.1.0" targetFramework="net452" />
78
</packages>

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,4 @@ You can also help by filing issues, participating in discussions and doing code
2626

2727
## Building
2828

29-
Visual Studio 2015 RC is required for building this repository.
30-
The Visual Studio 2015 RC SDK is required for building the vsix extension project and for
31-
debugging in an experimental visual studio hive.
29+
Visual Studio 2017 (Community Edition or higher) is required for building this repository.

LICENSE

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) Tunnel Vision Laboratories, LLC. All rights reserved.
1+
Copyright (c) Tunnel Vision Laboratories, LLC. All rights reserved.
22

33
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
44
these files except in compliance with the License. You may obtain a copy of the
@@ -45,3 +45,25 @@ Code Cracker
4545
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
4646
CONDITIONS OF ANY KIND, either express or implied. See the License for the
4747
specific language governing permissions and limitations under the License.
48+
49+
LightJson
50+
51+
Copyright (c) 2017 Marcos López C.
52+
53+
Permission is hereby granted, free of charge, to any person obtaining a copy
54+
of this software and associated documentation files (the "Software"), to deal
55+
in the Software without restriction, including without limitation the rights
56+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
57+
copies of the Software, and to permit persons to whom the Software is
58+
furnished to do so, subject to the following conditions:
59+
60+
The above copyright notice and this permission notice shall be included in
61+
all copies or substantial portions of the Software.
62+
63+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
64+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
66+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
67+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
68+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
69+
THE SOFTWARE.

NuGet.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="roslyn" value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
5+
<add key="symreader-converter" value="https://dotnet.myget.org/F/symreader-converter/api/v3/index.json" />
6+
</packageSources>
7+
</configuration>

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# StyleCop Analyzers for the .NET Compiler Platform
22

3+
[![NuGet](https://img.shields.io/nuget/v/StyleCop.Analyzers.svg)](https://www.nuget.org/packages/StyleCop.Analyzers)[![NuGet Beta](https://img.shields.io/nuget/vpre/StyleCop.Analyzers.svg)](https://www.nuget.org/packages/StyleCop.Analyzers)
4+
35
[![Join the chat at https://gitter.im/DotNetAnalyzers/StyleCopAnalyzers](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/DotNetAnalyzers/StyleCopAnalyzers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
46

57
[![Build status](https://ci.appveyor.com/api/projects/status/8jw2lq431kgg44jl/branch/master?svg=true)](https://ci.appveyor.com/project/sharwell/stylecopanalyzers/branch/master)
@@ -13,9 +15,9 @@ This repository contains an implementation of the StyleCop rules using the .NET
1315
The preferable way to use the analyzers is to add the nuget package [StyleCop.Analyzers](http://www.nuget.org/packages/StyleCop.Analyzers/)
1416
to the project where you want to enforce StyleCop rules.
1517

16-
The severity of individual rules may be configured using [rule set files](https://msdn.microsoft.com/en-us/library/dd264996.aspx)
17-
in Visual Studio 2015. **Settings.StyleCop** is not supported, but a **stylecop.json** file may be used to customize the
18-
behavior of certain rules. See [Configuration.md](documentation/Configuration.md) for more information.
18+
The severity of individual rules may be configured using [rule set files](https://docs.microsoft.com/en-us/visualstudio/code-quality/using-rule-sets-to-group-code-analysis-rules)
19+
in Visual Studio 2015 or newer. **Settings.StyleCop** is not supported, but a **stylecop.json** file may be used to
20+
customize the behavior of certain rules. See [Configuration.md](documentation/Configuration.md) for more information.
1921

2022
For users upgrading from StyleCop Classic, see [KnownChanges.md](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/tree/master/documentation/KnownChanges.md)
2123
for information about known differences which you may notice when switching to StyleCop Analyzers.
@@ -34,7 +36,7 @@ Install-Package StyleCop.Analyzers
3436

3537
## Team Considerations
3638

37-
If you use older versions of Visual Studio in addition to Visual Studio 2015, you may still install these analyzers. They will be automatically disabled when you open the project back up in Visual Studio 2013 or earlier.
39+
If you use older versions of Visual Studio in addition to Visual Studio 2015 or Visual Studio 2017, you may still install these analyzers. They will be automatically disabled when you open the project back up in Visual Studio 2013 or earlier.
3840

3941
## Contributing
4042

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
4+
<PropertyGroup>
5+
<Description>An implementation of StyleCop rules using the .NET Compiler Platform</Description>
6+
<Product>StyleCop.Analyzers</Product>
7+
<Company>Tunnel Vision Laboratories, LLC</Company>
8+
<Copyright>Copyright © Tunnel Vision Laboratories, LLC 2015</Copyright>
9+
<NeutralLanguage>en-US</NeutralLanguage>
10+
11+
<Version>1.1.0.37</Version>
12+
<FileVersion>1.1.0.37</FileVersion>
13+
<InformationalVersion>1.1.0-dev</InformationalVersion>
14+
</PropertyGroup>
15+
16+
<PropertyGroup>
17+
<EnableDefaultNoneItems>False</EnableDefaultNoneItems>
18+
</PropertyGroup>
19+
20+
<PropertyGroup>
21+
<LangVersion>6</LangVersion>
22+
<Features>strict</Features>
23+
</PropertyGroup>
24+
25+
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
26+
<!-- Ideally this is always enabled, but that tends to hurt developer productivity -->
27+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
28+
</PropertyGroup>
29+
30+
<PropertyGroup>
31+
<DebugType>portable</DebugType>
32+
<DebugSymbols>true</DebugSymbols>
33+
</PropertyGroup>
34+
35+
<PropertyGroup>
36+
<!--
37+
Make sure any documentation comments which are included in code get checked for syntax during the build, but do
38+
not report warnings for missing comments.
39+
40+
CS1573: Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do)
41+
CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
42+
-->
43+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
44+
<NoWarn>$(NoWarn),1573,1591</NoWarn>
45+
</PropertyGroup>
46+
47+
<ItemGroup>
48+
<PackageReference Include="AsyncUsageAnalyzers" Version="1.0.0-alpha003" PrivateAssets="all" />
49+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta006" PrivateAssets="all" />
50+
</ItemGroup>
51+
52+
<ItemGroup>
53+
<None Include="$(MSBuildThisFileDirectory)*.ruleset" Link="%(Filename)%(Extension)" />
54+
55+
<!-- Show launchSettings.json in the project if it exists. -->
56+
<None Include="$(AppDesignerFolder)\launchSettings.json" Condition="Exists('$(AppDesignerFolder)\launchSettings.json')" />
57+
</ItemGroup>
58+
59+
<ItemGroup>
60+
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json">
61+
<Link>stylecop.json</Link>
62+
</AdditionalFiles>
63+
</ItemGroup>
64+
65+
</Project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
4+
<ItemGroup>
5+
<!-- Enable code generation for resource files -->
6+
<CodeGenerationEmbeddedResource Include="@(EmbeddedResource)" Exclude="**\*.??-??.resx" />
7+
<EmbeddedResource Update="@(CodeGenerationEmbeddedResource)" Generator="ResXFileCodeGenerator" />
8+
</ItemGroup>
9+
10+
<!-- Special handling for embedded resources and generated files to show as nested in Solution Explorer -->
11+
<ItemGroup>
12+
<!-- Update designer files for *.resx files -->
13+
<Compile Update="@(CodeGenerationEmbeddedResource->'%(RecursiveDir)%(Filename).Designer.cs')" DependentUpon="$([System.IO.Path]::ChangeExtension($([System.IO.Path]::GetFileNameWithoutExtension(%(Identity))), '.resx'))" />
14+
15+
<!-- Localized embedded resources are just dependent on the parent RESX -->
16+
<EmbeddedResource Update="**\*.??-??.resx" DependentUpon="$([System.IO.Path]::ChangeExtension($([System.IO.Path]::GetFileNameWithoutExtension(%(Identity))), '.resx'))" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<None Include="$(MSBuildProjectFileDirectory)$(AssemblyOriginatorKeyFile)" Link="%(Filename)%(Extension)" />
21+
</ItemGroup>
22+
23+
</Project>

0 commit comments

Comments
 (0)