Skip to content

Commit 56d687f

Browse files
martijn00Ersan Bozduman
andauthored
Warnings again (#796)
* Fix more warnings * Nuget update * Extend interface * Move progres * Namespace changes * Format * Renames * Moves * More moves * More warnings * Use new package for reactive * Add editor config * Allow 0 * Fix warnings * Warnings as error * Lint changes * Revert "Drawingback Lint changes" This reverts commit ed1ba1b. * Fix lines * Add editor config update * More editor * More editorconfig * Format * Format * Format * Fixes * Format * Format * Runs bucket notification test by itself --------- Co-authored-by: Ersan Bozduman <ersanbozduman@gmail.com>
1 parent 827e2d3 commit 56d687f

File tree

375 files changed

+6626
-4332
lines changed

Some content is hidden

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

375 files changed

+6626
-4332
lines changed

.editorconfig

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# EditorConfig is awesome:http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*.{cs,vb}]
7+
#### Naming styles ####
8+
9+
# Unix-style newlines with a newline ending every file
10+
[*]
11+
end_of_line = lf
12+
insert_final_newline = true
13+
14+
# Naming rules
15+
16+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
17+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
18+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
19+
20+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
21+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
22+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
23+
24+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
25+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
26+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
27+
28+
# Symbol specifications
29+
30+
dotnet_naming_symbols.interface.applicable_kinds = interface
31+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
32+
dotnet_naming_symbols.interface.required_modifiers =
33+
34+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
35+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
36+
dotnet_naming_symbols.types.required_modifiers =
37+
38+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
39+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
40+
dotnet_naming_symbols.non_field_members.required_modifiers =
41+
42+
# Naming styles
43+
44+
dotnet_naming_style.begins_with_i.required_prefix = I
45+
dotnet_naming_style.begins_with_i.required_suffix =
46+
dotnet_naming_style.begins_with_i.word_separator =
47+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
48+
49+
dotnet_naming_style.pascal_case.required_prefix =
50+
dotnet_naming_style.pascal_case.required_suffix =
51+
dotnet_naming_style.pascal_case.word_separator =
52+
dotnet_naming_style.pascal_case.capitalization = pascal_case
53+
54+
dotnet_naming_style.pascal_case.required_prefix =
55+
dotnet_naming_style.pascal_case.required_suffix =
56+
dotnet_naming_style.pascal_case.word_separator =
57+
dotnet_naming_style.pascal_case.capitalization = pascal_case
58+
dotnet_style_coalesce_expression = true:suggestion
59+
dotnet_style_null_propagation = true:suggestion
60+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
61+
dotnet_style_prefer_auto_properties = true:silent
62+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
63+
tab_width = 4
64+
indent_size = 4
65+
end_of_line = crlf
66+
dotnet_style_object_initializer = true:suggestion
67+
dotnet_style_collection_initializer = true:suggestion
68+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
69+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
70+
dotnet_style_prefer_conditional_expression_over_return = true:silent
71+
dotnet_style_explicit_tuple_names = true:suggestion
72+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
73+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
74+
dotnet_style_prefer_compound_assignment = true:suggestion
75+
dotnet_style_prefer_simplified_interpolation = true:suggestion
76+
dotnet_style_namespace_match_folder = true:suggestion
77+
dotnet_style_readonly_field = true:suggestion
78+
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
79+
dotnet_style_predefined_type_for_member_access = true:silent
80+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
81+
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
82+
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
83+
dotnet_code_quality_unused_parameters = all:suggestion
84+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
85+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
86+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
87+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
88+
dotnet_style_qualification_for_field = false:silent
89+
dotnet_style_qualification_for_property = false:silent
90+
dotnet_style_qualification_for_method = false:silent
91+
dotnet_style_qualification_for_event = false:silent
92+
93+
[*.cs]
94+
MA0051.maximum_lines_per_method = 100
95+
MA0051.maximum_statements_per_method = 60
96+
MA0051.skip_local_functions = false # skip local functions when counting statements
97+
csharp_using_directive_placement = outside_namespace:suggestion
98+
csharp_prefer_simple_using_statement = true:suggestion
99+
csharp_prefer_braces = when_multiline:suggestion
100+
csharp_style_namespace_declarations = file_scoped:warning
101+
csharp_style_prefer_method_group_conversion = true:silent
102+
csharp_style_prefer_top_level_statements = true:warning
103+
csharp_style_prefer_primary_constructors = true:suggestion
104+
csharp_style_expression_bodied_methods = false:silent
105+
csharp_style_expression_bodied_constructors = false:silent
106+
csharp_style_expression_bodied_operators = false:silent
107+
csharp_style_expression_bodied_properties = true:suggestion
108+
csharp_style_expression_bodied_indexers = true:suggestion
109+
csharp_style_expression_bodied_accessors = true:suggestion
110+
csharp_style_expression_bodied_lambdas = true:suggestion
111+
csharp_style_expression_bodied_local_functions = false:silent
112+
csharp_indent_labels = one_less_than_current
113+
csharp_space_around_binary_operators = before_and_after
114+
csharp_style_throw_expression = true:suggestion
115+
csharp_style_prefer_null_check_over_type_check = true:suggestion
116+
csharp_prefer_simple_default_expression = true:suggestion
117+
csharp_style_prefer_local_over_anonymous_function = true:suggestion
118+
csharp_style_prefer_index_operator = true:suggestion
119+
csharp_style_prefer_range_operator = true:suggestion
120+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
121+
csharp_style_prefer_tuple_swap = true:suggestion
122+
csharp_style_prefer_utf8_string_literals = true:suggestion
123+
csharp_style_inlined_variable_declaration = true:suggestion
124+
csharp_style_deconstructed_variable_declaration = true:suggestion
125+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
126+
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
127+
csharp_prefer_static_local_function = true:suggestion
128+
csharp_style_prefer_readonly_struct = true:suggestion
129+
csharp_style_prefer_readonly_struct_member = true:suggestion
130+
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
131+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false:silent
132+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
133+
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
134+
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
135+
csharp_style_conditional_delegate_call = true:suggestion
136+
csharp_style_prefer_switch_expression = true:suggestion
137+
csharp_style_prefer_pattern_matching = true:silent
138+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
139+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
140+
csharp_style_prefer_not_pattern = true:suggestion
141+
csharp_style_prefer_extended_property_pattern = true:suggestion
142+
csharp_style_var_for_built_in_types = true:suggestion
143+
csharp_style_var_when_type_is_apparent = true:suggestion
144+
csharp_style_var_elsewhere = true:suggestion
145+
csharp_preserve_single_line_blocks = true
146+
csharp_preserve_single_line_statements = true
147+
csharp_indent_braces = false
148+
csharp_new_line_before_members_in_object_initializers = false
149+
csharp_new_line_before_open_brace = all

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
###############################################################################
22
# Set default behavior to automatically normalize line endings.
33
###############################################################################
4-
* text=lf
4+
* text=auto eol=lf
55

66
# Check out the following as ln always for osx/linux/cygwin
77
*.sh text eol=lf

Directory.Build.props

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
<NoWarn>$(NoWarn);CS1591</NoWarn>
2525
<Platform>AnyCPU</Platform>
2626

27-
<EnableNETAnalyzers>false</EnableNETAnalyzers>
27+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
2828
<AnalysisLevel>latest</AnalysisLevel>
29-
<AnalysisMode>All</AnalysisMode>
29+
<AnalysisMode>Default</AnalysisMode>
30+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3031

3132
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
3233
</PropertyGroup>
@@ -78,11 +79,11 @@
7879
<PrivateAssets>all</PrivateAssets>
7980
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
8081
</PackageReference>
81-
<PackageReference Include="Meziantou.Analyzer" Version="2.0.60">
82+
<PackageReference Include="Meziantou.Analyzer" Version="2.0.61">
8283
<PrivateAssets>all</PrivateAssets>
8384
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
8485
</PackageReference>
8586
-->
8687
</ItemGroup>
8788

88-
</Project>
89+
</Project>

FileUploader/FileUpload.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using System.Net;
1818
using System.Runtime.InteropServices;
1919
using Minio;
20+
using Minio.DataModel.Args;
2021

2122
namespace FileUploader;
2223

@@ -107,4 +108,4 @@ private static async Task Run(IMinioClient minio)
107108
// run in, dissappears as soon as the test code completes.
108109
if (IsWindows()) Console.ReadLine();
109110
}
110-
}
111+
}

Minio.Examples/Cases/AWSEnvironmentProviderExample.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
using Minio.Credentials;
19+
using Minio.DataModel.Args;
1920
using Minio.Exceptions;
2021

2122
namespace Minio.Examples.Cases;
@@ -48,4 +49,4 @@ public static async Task Run()
4849
Console.WriteLine($"[Bucket] IAMAWSProviderExample example case encountered Exception: {e}");
4950
}
5051
}
51-
}
52+
}

Minio.Examples/Cases/AssumeRoleProviderExample.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
//
1717

1818
using Minio.Credentials;
19+
using Minio.DataModel.Args;
1920

2021
namespace Minio.Examples.Cases;
2122

@@ -63,4 +64,4 @@ public static async Task Run()
6364
Console.WriteLine($"AssumeRoleProvider test exception: {e}\n");
6465
}
6566
}
66-
}
67+
}

Minio.Examples/Cases/BucketExists.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
using Minio.DataModel.Args;
18+
1719
namespace Minio.Examples.Cases;
1820

1921
internal static class BucketExists
@@ -36,4 +38,4 @@ public static async Task Run(IMinioClient minio,
3638
Console.WriteLine($"[Bucket] Exception: {e}");
3739
}
3840
}
39-
}
41+
}

Minio.Examples/Cases/CertificateIdentityProviderExample.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
using System.Security.Cryptography.X509Certificates;
1919
using Minio.Credentials;
20+
using Minio.DataModel.Args;
2021

2122
namespace Minio.Examples.Cases;
2223

@@ -56,4 +57,4 @@ public static async Task Run()
5657
Console.WriteLine($"\nCertificateIdentityProvider test exception: {e}\n");
5758
}
5859
}
59-
}
60+
}

Minio.Examples/Cases/ChainedCredentialProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
using Minio.Credentials;
19+
using Minio.DataModel.Args;
1920
using Minio.Exceptions;
2021

2122
namespace Minio.Examples.Cases;
@@ -49,4 +50,4 @@ public static async Task Run()
4950
Console.WriteLine($"[Bucket] ChainedCredentialProvider example case encountered Exception: {e}");
5051
}
5152
}
52-
}
53+
}

Minio.Examples/Cases/ClearObjectRetention.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
using Minio.DataModel.Args;
18+
1719
namespace Minio.Examples.Cases;
1820

1921
public static class ClearObjectRetention
@@ -45,4 +47,4 @@ await minio.ClearObjectRetentionAsync(
4547
Console.WriteLine($"[Object] Exception: {e}");
4648
}
4749
}
48-
}
50+
}

0 commit comments

Comments
 (0)