Skip to content

Commit 0c6890e

Browse files
committed
#35 - Added editorconfig to enforce using Western European Windows file encoding.
1 parent b1c0f45 commit 0c6890e

File tree

5 files changed

+683
-585
lines changed

5 files changed

+683
-585
lines changed

.editorconfig

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
root = true
2+
3+
[*]
4+
insert_final_newline = true
5+
6+
[*.cs]
7+
indent_style = tab
8+
indent_size = 4
9+
charset = Windows-1252 # Western European Windows
10+
csharp_indent_labels = one_less_than_current
11+
csharp_using_directive_placement = outside_namespace:silent
12+
csharp_prefer_simple_using_statement = true:suggestion
13+
csharp_prefer_braces = true:silent
14+
csharp_style_namespace_declarations = block_scoped:silent
15+
csharp_style_prefer_method_group_conversion = true:silent
16+
csharp_style_prefer_top_level_statements = true:silent
17+
csharp_style_prefer_primary_constructors = true:suggestion
18+
csharp_style_expression_bodied_methods = false:silent
19+
csharp_style_expression_bodied_constructors = false:silent
20+
csharp_style_expression_bodied_operators = false:silent
21+
csharp_style_expression_bodied_properties = true:silent
22+
csharp_style_expression_bodied_indexers = true:silent
23+
csharp_style_expression_bodied_accessors = true:silent
24+
csharp_style_expression_bodied_lambdas = true:silent
25+
csharp_style_expression_bodied_local_functions = false:silent
26+
csharp_style_throw_expression = true:suggestion
27+
csharp_style_prefer_null_check_over_type_check = true:suggestion
28+
csharp_prefer_simple_default_expression = true:suggestion
29+
csharp_style_prefer_local_over_anonymous_function = true:suggestion
30+
csharp_style_prefer_index_operator = true:suggestion
31+
32+
[*.{cs,vb}]
33+
#### Naming styles ####
34+
35+
# Naming rules
36+
37+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
38+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
39+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
40+
41+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
42+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
43+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
44+
45+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
46+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
47+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
48+
49+
# Symbol specifications
50+
51+
dotnet_naming_symbols.interface.applicable_kinds = interface
52+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
53+
dotnet_naming_symbols.interface.required_modifiers =
54+
55+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
56+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
57+
dotnet_naming_symbols.types.required_modifiers =
58+
59+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
60+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
61+
dotnet_naming_symbols.non_field_members.required_modifiers =
62+
63+
# Naming styles
64+
65+
dotnet_naming_style.begins_with_i.required_prefix = I
66+
dotnet_naming_style.begins_with_i.required_suffix =
67+
dotnet_naming_style.begins_with_i.word_separator =
68+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
69+
70+
dotnet_naming_style.pascal_case.required_prefix =
71+
dotnet_naming_style.pascal_case.required_suffix =
72+
dotnet_naming_style.pascal_case.word_separator =
73+
dotnet_naming_style.pascal_case.capitalization = pascal_case
74+
75+
dotnet_naming_style.pascal_case.required_prefix =
76+
dotnet_naming_style.pascal_case.required_suffix =
77+
dotnet_naming_style.pascal_case.word_separator =
78+
dotnet_naming_style.pascal_case.capitalization = pascal_case
79+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
80+
tab_width = 4
81+
indent_size = 4
82+
end_of_line = crlf
83+
dotnet_style_coalesce_expression = true:suggestion
84+
dotnet_style_null_propagation = true:suggestion
85+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
86+
dotnet_style_prefer_auto_properties = true:silent
87+
dotnet_style_object_initializer = true:suggestion
88+
dotnet_style_collection_initializer = true:suggestion
89+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
90+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
91+
dotnet_style_prefer_conditional_expression_over_return = true:silent
92+
dotnet_style_explicit_tuple_names = true:suggestion
93+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
94+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
95+
dotnet_style_prefer_compound_assignment = true:suggestion
96+
dotnet_style_prefer_simplified_interpolation = true:suggestion
97+
dotnet_style_namespace_match_folder = true:suggestion
98+
indent_style = tab

AspNetSaml.Tests/Constants.cs

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
using System.Security.Cryptography.X509Certificates;
1+
using System.Security.Cryptography.X509Certificates;
22

33
namespace AspNetSaml.Tests;
44

55
public static class Constants
66
{
7-
/// <summary>
8-
/// Test certificate values.
9-
/// </summary>
10-
/// <remarks>
11-
/// Self-signed certificates generated by https://www.samltool.com/self_signed_certs.php.
12-
/// </remarks>
13-
public static class Certificates
14-
{
15-
public const string Country = "US";
16-
public const string State = "New York";
17-
public const string Locality = "New York City";
18-
public const string Organization = "AspNetSaml";
19-
public const string Domain = "aspnetsaml.jitbit.local";
20-
public const string DigestAlgorithm = "SHA512";
7+
/// <summary>
8+
/// Test certificate values.
9+
/// </summary>
10+
/// <remarks>
11+
/// Self-signed certificates generated by https://www.samltool.com/self_signed_certs.php.
12+
/// </remarks>
13+
public static class Certificates
14+
{
15+
public const string Country = "US";
16+
public const string State = "New York";
17+
public const string Locality = "New York City";
18+
public const string Organization = "AspNetSaml";
19+
public const string Domain = "aspnetsaml.jitbit.local";
20+
public const string DigestAlgorithm = "SHA512";
2121

22-
/// <summary>
23-
/// Private key raw text.
24-
/// </summary>
25-
public const string PrivateKey = @"-----BEGIN PRIVATE KEY-----
22+
/// <summary>
23+
/// Private key raw text.
24+
/// </summary>
25+
public const string PrivateKey = @"-----BEGIN PRIVATE KEY-----
2626
MIIEwgIBADANBgkqhkiG9w0BAQEFAASCBKwwggSoAgEAAoIBAgDb+eVLX3/pcYbX
2727
gustW1YSSTIe737KuJqL9CxibjL2jaEXvoM0zllwYdyvWdrnoJ8tABoKHPtSGRJv
2828
6fH7+cq31zLj50R6Wz4uzdZr37opBdk5ea0YHeaOOmNu1ikfFNMaT0VXuj9kqod8
@@ -51,10 +51,10 @@ public static class Certificates
5151
XY1SLPWC2KRvi85oYPvpNFI1NKUD1g==
5252
-----END PRIVATE KEY-----";
5353

54-
/// <summary>
55-
/// Certificate raw text.
56-
/// </summary>
57-
public const string PublicCertificate = @"-----BEGIN CERTIFICATE-----
54+
/// <summary>
55+
/// Certificate raw text.
56+
/// </summary>
57+
public const string PublicCertificate = @"-----BEGIN CERTIFICATE-----
5858
MIIDzzCCAragAwIBAgIBADANBgkqhkiG9w0BAQ0FADCBgDELMAkGA1UEBhMCdXMx
5959
ETAPBgNVBAgMCE5ldyBZb3JrMQ8wDQYDVQQKDAZKaXRiaXQxIDAeBgNVBAMMF2Fz
6060
cG5ldHNhbWwuaml0Yml0LmxvY2FsMRYwFAYDVQQHDA1OZXcgWW9yayBDaXR5MRMw
@@ -78,10 +78,10 @@ public static class Certificates
7878
ugfn/Qef81oPEImyoMWd0ReQvA==
7979
-----END CERTIFICATE-----";
8080

81-
/// <summary>
82-
/// CSR raw text.
83-
/// </summary>
84-
public const string CertificateSigningRequest = @"-----BEGIN CERTIFICATE REQUEST-----
81+
/// <summary>
82+
/// CSR raw text.
83+
/// </summary>
84+
public const string CertificateSigningRequest = @"-----BEGIN CERTIFICATE REQUEST-----
8585
MIICyDCCAa8CAQAwgYAxCzAJBgNVBAYTAnVzMREwDwYDVQQIDAhOZXcgWW9yazEP
8686
MA0GA1UECgwGSml0Yml0MSAwHgYDVQQDDBdhc3BuZXRzYW1sLmppdGJpdC5sb2Nh
8787
bDEWMBQGA1UEBwwNTmV3IFlvcmsgQ2l0eTETMBEGA1UECwwKQXNwTmV0U2FtbDCC
@@ -99,9 +99,9 @@ public static class Certificates
9999
t9RbkNHiT5rwOlSe3b86oonejHDEj4RDVNr89/6LJ3KxAsL5bUGCJaQbhWU=
100100
-----END CERTIFICATE REQUEST-----";
101101

102-
/// <summary>
103-
/// Test certificate instance.
104-
/// </summary>
105-
public static X509Certificate2 Certificate => new Lazy<X509Certificate2>(() => X509Certificate2.CreateFromPem(PublicCertificate, PrivateKey)).Value;
106-
}
102+
/// <summary>
103+
/// Test certificate instance.
104+
/// </summary>
105+
public static X509Certificate2 Certificate => new Lazy<X509Certificate2>(() => X509Certificate2.CreateFromPem(PublicCertificate, PrivateKey)).Value;
106+
}
107107
}

0 commit comments

Comments
 (0)