Skip to content

Commit e397229

Browse files
committed
Merge branch 'master' into fix-1987
2 parents 584a021 + ac10b44 commit e397229

985 files changed

Lines changed: 49535 additions & 8652 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 & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ If you want to contribute code you can get started by looking for issues marked
55
We also have the [easy](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/labels/easy) tag
66
for issues suitable if you are unfamiliar with roslyn.
77

8-
Also see the [contributing guide](CONTRIBUTING.md).
9-
108
You can also help by filing issues, participating in discussions and doing code review.
119

1210
## Implementing a diagnostic
@@ -28,6 +26,4 @@ You can also help by filing issues, participating in discussions and doing code
2826

2927
## Building
3028

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

DOCUMENTATION.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
StyleCop.Analyzers provides warnings that indicate style and consistency rule violations in C# code. The warnings are organized into rule areas such as documentation, layout, naming, ordering, readability, spacing, and so forth. Each warning signifies a violation of a style or consistency rule. This section provides an explanation of each of the default StyleCop.Analyzers rules.
2+
3+
### Rule areas
4+
**[Special Rules (SA0000-)](documentation/SpecialRules.md)**
5+
6+
Rules which provide special functionality like workarounds, configuration errors, etc.
7+
8+
**[Spacing Rules (SA1000-)](documentation/SpacingRules.md)**
9+
10+
Rules which enforce spacing requirements around keywords and symbols in the code.
11+
12+
**[Readability Rules (SA1100-)](documentation/ReadabilityRules.md)**
13+
14+
Rules which ensure that the code is well-formatted and readable.
15+
16+
**[Ordering Rules (SA1200-)](documentation/OrderingRules.md)**
17+
18+
Rules which enforce a standard ordering scheme for code contents.
19+
20+
**[Naming Rules (SA1300-)](documentation/NamingRules.md)**
21+
22+
Rules which enforce naming requirements for members, types, and variables.
23+
24+
**[Maintainability Rules (SA1400-)](documentation/MaintainabilityRules.md)**
25+
26+
Rules which improve code maintainability.
27+
28+
**[Layout Rules (SA1500-)](documentation/LayoutRules.md)**
29+
30+
Rules which enforce code layout and line spacing.
31+
32+
**[Documentation Rules (SA1600-)](documentation/DocumentationRules.md)**
33+
34+
Rules which verify the content and formatting of code documentation.
35+
36+
**[Alternative Rules (SX0000-)](documentation/AlternativeRules.md)**
37+
38+
Rules which offer a non-standard extension to the default StyleCop behavior.
39+
40+
### Additional documentation
41+
**[Configuration](documentation/Configuration.md)**
42+
43+
Describes the configuration options for StyleCop.Analyzers
44+
45+
**[How to enable the configuration](documentation/EnableConfiguration.md)**
46+
47+
Describes how to enable the **stylecop.json** file for usage.
48+
49+
**[Known changes](documentation/KnownChanges.md)**
50+
51+
Describes the known differences between StyleCop Analyzers and StyleCop Classic.

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: 13 additions & 9 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,22 +15,28 @@ 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.
2224

2325
## Installation
2426

25-
StyleCopAnalyzers can be installed using the NuGet Package Manager in Visual Studio 2015.
27+
StyleCopAnalyzers can be installed using the NuGet command line or the NuGet Package Manager in Visual Studio 2015.
28+
29+
**Install using the command line:**
30+
```bash
31+
Install-Package StyleCop.Analyzers
32+
```
2633

34+
**Install using the package manager:**
2735
![Install via nuget](https://cloud.githubusercontent.com/assets/1408396/8233513/491f301a-159c-11e5-8b7a-1e16a0695da6.png)
2836

2937
## Team Considerations
3038

31-
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.
3240

3341
## Contributing
3442

@@ -37,7 +45,3 @@ See [Contributing](CONTRIBUTING.md)
3745
## Current status
3846

3947
An up-to-date list of which StyleCop rules are implemented and which have code fixes can be found [here](https://stylecop.pdelvo.com/).
40-
41-
## Source browser
42-
43-
The up-to-date source code can be browsed [here](https://source.pdelvo.com/).
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>

0 commit comments

Comments
 (0)