Skip to content

Commit 87189c9

Browse files
Add StyleCop.Analyzers
1 parent 4a6e49c commit 87189c9

File tree

5 files changed

+125
-18
lines changed

5 files changed

+125
-18
lines changed

.editorconfig

Lines changed: 104 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,55 @@
1-
# editorconfig.org
2-
3-
# top-most EditorConfig file
41
root = true
52

6-
# Default settings:
7-
# A newline ending every file
8-
# Use 4 spaces as indentation
93
[*]
104
insert_final_newline = true
115
end_of_line = lf
126
indent_style = space
137
indent_size = 4
14-
15-
# Trim trailing whitespace, limited support.
16-
# https://github.com/editorconfig/editorconfig/wiki/Property-research:-Trim-trailing-spaces
178
trim_trailing_whitespace = true
189

10+
csharp_indent_braces = false
11+
csharp_indent_case_contents = true
12+
csharp_indent_labels = one_less_than_current
13+
csharp_prefer_braces = true:warning
14+
csharp_prefer_simple_default_expression = true:suggestion
15+
csharp_prefer_simple_using_statement = true:suggestion
16+
csharp_prefer_static_local_function = true:suggestion
17+
csharp_space_around_binary_operators = before_and_after
18+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
19+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
20+
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
21+
csharp_style_conditional_delegate_call = true:suggestion
22+
csharp_style_deconstructed_variable_declaration = true:suggestion
23+
csharp_style_expression_bodied_accessors = true:silent
24+
csharp_style_expression_bodied_constructors = true:silent
25+
csharp_style_expression_bodied_indexers = true:silent
26+
csharp_style_expression_bodied_lambdas = true:silent
27+
csharp_style_expression_bodied_local_functions = false:silent
28+
csharp_style_expression_bodied_methods = true:silent
29+
csharp_style_expression_bodied_operators = true:silent
30+
csharp_style_expression_bodied_properties = true:silent
31+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
32+
csharp_style_inlined_variable_declaration = true:suggestion
33+
csharp_style_namespace_declarations = block_scoped:silent
34+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
35+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
36+
csharp_style_prefer_extended_property_pattern = true:suggestion
37+
csharp_style_prefer_index_operator = true:suggestion
38+
csharp_style_prefer_local_over_anonymous_function = true:suggestion
39+
csharp_style_prefer_not_pattern = true:suggestion
40+
csharp_style_prefer_null_check_over_type_check = true:suggestion
41+
csharp_style_prefer_pattern_matching = true:silent
42+
csharp_style_prefer_range_operator = true:suggestion
43+
csharp_style_prefer_switch_expression = true:suggestion
44+
csharp_style_prefer_tuple_swap = true:suggestion
45+
csharp_style_throw_expression = true:suggestion
46+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
47+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
48+
csharp_style_var_elsewhere = false:silent
49+
csharp_style_var_for_built_in_types = false:silent
50+
csharp_style_var_when_type_is_apparent = false:silent
51+
csharp_using_directive_placement = outside_namespace:silent
52+
1953
[*.md]
2054
insert_final_newline = false
2155
trim_trailing_whitespace = false
@@ -24,16 +58,70 @@ trim_trailing_whitespace = false
2458
indent_size = 2
2559

2660
[*.{cs,vb}]
27-
dotnet_style_predefined_type_for_locals_parameters_members = true:error
61+
tab_width = 4
2862

29-
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
30-
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
63+
dotnet_code_quality_unused_parameters = all:suggestion
3164
dotnet_naming_rule.private_members_with_underscore.severity = suggestion
32-
33-
dotnet_naming_symbols.private_fields.applicable_kinds = field
34-
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
35-
65+
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
66+
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
3667
dotnet_naming_style.prefix_underscore.capitalization = camel_case
3768
dotnet_naming_style.prefix_underscore.required_prefix = _
69+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
70+
dotnet_naming_symbols.private_fields.applicable_kinds = field
71+
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
72+
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
73+
dotnet_style_coalesce_expression = true:suggestion
74+
dotnet_style_collection_initializer = true:suggestion
75+
dotnet_style_explicit_tuple_names = true:suggestion
76+
dotnet_style_namespace_match_folder = true:suggestion
77+
dotnet_style_null_propagation = true:suggestion
78+
dotnet_style_object_initializer = true:suggestion
79+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
80+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
81+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
82+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
83+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
84+
dotnet_style_predefined_type_for_locals_parameters_members = true:error
85+
dotnet_style_predefined_type_for_member_access = true:silent
86+
dotnet_style_prefer_auto_properties = true:silent
87+
dotnet_style_prefer_compound_assignment = true:suggestion
88+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
89+
dotnet_style_prefer_conditional_expression_over_return = true:silent
90+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
91+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
92+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
93+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
94+
dotnet_style_prefer_simplified_interpolation = true:suggestion
95+
dotnet_style_qualification_for_event = false:silent
96+
dotnet_style_qualification_for_field = false:silent
97+
dotnet_style_qualification_for_method = false:silent
98+
dotnet_style_qualification_for_property = false:silent
99+
dotnet_style_readonly_field = true:suggestion
100+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
38101

102+
# CA1054: URI parameters should not be strings
39103
dotnet_diagnostic.CA1054.severity = suggestion
104+
105+
# CA1055: URI-like return values should not be strings
106+
dotnet_diagnostic.CA1055.severity = none
107+
108+
# RS0048: Missing shipped or unshipped public API file
109+
dotnet_public_api_analyzer.require_api_files = true
110+
111+
# SA1101: Prefix local calls with this
112+
dotnet_diagnostic.SA1101.severity = none
113+
114+
# SA1309: Field names should not begin with underscore
115+
dotnet_diagnostic.SA1309.severity = none
116+
117+
# SA1413: Use trailing comma in multi-line initializers
118+
dotnet_diagnostic.SA1413.severity = none
119+
120+
# SA1502: Element should not be on a single line
121+
dotnet_diagnostic.SA1502.severity = none
122+
123+
# SA1625: Element documentation should not be copied and pasted
124+
dotnet_diagnostic.SA1625.severity = none
125+
126+
# SA1633: File should have header
127+
dotnet_diagnostic.SA1633.severity = none

src/Directory.Build.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
<None Include="$(MSBuildThisFileDirectory)/../icon.png" Pack="true" PackagePath="/" Visible="false" />
2323
</ItemGroup>
2424

25+
<ItemGroup>
26+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="All" />
27+
</ItemGroup>
28+
2529
<!-- SourceLink -->
2630
<PropertyGroup>
2731
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
using System;
22

3-
[assembly:CLSCompliant(false)]
3+
// This assembly exposes types that are not CLS-compliant
4+
[assembly: CLSCompliant(false)]

src/Umbraco.Cloud.StorageProviders.AzureBlob/Umbraco.Cloud.StorageProviders.AzureBlob.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<PackageTags>umbraco cloud storage azure blob</PackageTags>
99
</PropertyGroup>
1010
<ItemGroup>
11-
<PackageReference Include="Umbraco.StorageProviders.AzureBlob" Version="2.0.0-alpha-gfada1d18f0" />
11+
<PackageReference Include="Umbraco.StorageProviders.AzureBlob" Version="2.0.0-alpha-gfada1d18f0" IncludeAssets="compile" />
1212
</ItemGroup>
1313
</Project>

src/Umbraco.Cloud.StorageProviders.AzureBlob/packages.lock.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
"Microsoft.SourceLink.Common": "1.1.1"
1313
}
1414
},
15+
"StyleCop.Analyzers": {
16+
"type": "Direct",
17+
"requested": "[1.2.0-beta.435, )",
18+
"resolved": "1.2.0-beta.435",
19+
"contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==",
20+
"dependencies": {
21+
"StyleCop.Analyzers.Unstable": "1.2.0.435"
22+
}
23+
},
1524
"Umbraco.StorageProviders.AzureBlob": {
1625
"type": "Direct",
1726
"requested": "[2.0.0-alpha-gfada1d18f0, )",
@@ -1225,6 +1234,11 @@
12251234
"Smidge": "4.0.4"
12261235
}
12271236
},
1237+
"StyleCop.Analyzers.Unstable": {
1238+
"type": "Transitive",
1239+
"resolved": "1.2.0.435",
1240+
"contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg=="
1241+
},
12281242
"System.AppContext": {
12291243
"type": "Transitive",
12301244
"resolved": "4.3.0",

0 commit comments

Comments
 (0)