Skip to content

Commit

Permalink
#35 - Added editorconfig to enforce using Western European Windows fi…
Browse files Browse the repository at this point in the history
…le encoding.
  • Loading branch information
Havagan committed Aug 30, 2023
1 parent b1c0f45 commit 0c6890e
Show file tree
Hide file tree
Showing 5 changed files with 683 additions and 585 deletions.
98 changes: 98 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
root = true

[*]
insert_final_newline = true

[*.cs]
indent_style = tab
indent_size = 4
charset = Windows-1252 # Western European Windows
csharp_indent_labels = one_less_than_current
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_throw_expression = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion

[*.{cs,vb}]
#### Naming styles ####

# Naming rules

dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

# Symbol specifications

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
indent_style = tab
64 changes: 32 additions & 32 deletions AspNetSaml.Tests/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography.X509Certificates;

namespace AspNetSaml.Tests;

public static class Constants
{
/// <summary>
/// Test certificate values.
/// </summary>
/// <remarks>
/// Self-signed certificates generated by https://www.samltool.com/self_signed_certs.php.
/// </remarks>
public static class Certificates
{
public const string Country = "US";
public const string State = "New York";
public const string Locality = "New York City";
public const string Organization = "AspNetSaml";
public const string Domain = "aspnetsaml.jitbit.local";
public const string DigestAlgorithm = "SHA512";
/// <summary>
/// Test certificate values.
/// </summary>
/// <remarks>
/// Self-signed certificates generated by https://www.samltool.com/self_signed_certs.php.
/// </remarks>
public static class Certificates
{
public const string Country = "US";
public const string State = "New York";
public const string Locality = "New York City";
public const string Organization = "AspNetSaml";
public const string Domain = "aspnetsaml.jitbit.local";
public const string DigestAlgorithm = "SHA512";

/// <summary>
/// Private key raw text.
/// </summary>
public const string PrivateKey = @"-----BEGIN PRIVATE KEY-----
/// <summary>
/// Private key raw text.
/// </summary>
public const string PrivateKey = @"-----BEGIN PRIVATE KEY-----
MIIEwgIBADANBgkqhkiG9w0BAQEFAASCBKwwggSoAgEAAoIBAgDb+eVLX3/pcYbX
gustW1YSSTIe737KuJqL9CxibjL2jaEXvoM0zllwYdyvWdrnoJ8tABoKHPtSGRJv
6fH7+cq31zLj50R6Wz4uzdZr37opBdk5ea0YHeaOOmNu1ikfFNMaT0VXuj9kqod8
Expand Down Expand Up @@ -51,10 +51,10 @@ public static class Certificates
XY1SLPWC2KRvi85oYPvpNFI1NKUD1g==
-----END PRIVATE KEY-----";

/// <summary>
/// Certificate raw text.
/// </summary>
public const string PublicCertificate = @"-----BEGIN CERTIFICATE-----
/// <summary>
/// Certificate raw text.
/// </summary>
public const string PublicCertificate = @"-----BEGIN CERTIFICATE-----
MIIDzzCCAragAwIBAgIBADANBgkqhkiG9w0BAQ0FADCBgDELMAkGA1UEBhMCdXMx
ETAPBgNVBAgMCE5ldyBZb3JrMQ8wDQYDVQQKDAZKaXRiaXQxIDAeBgNVBAMMF2Fz
cG5ldHNhbWwuaml0Yml0LmxvY2FsMRYwFAYDVQQHDA1OZXcgWW9yayBDaXR5MRMw
Expand All @@ -78,10 +78,10 @@ public static class Certificates
ugfn/Qef81oPEImyoMWd0ReQvA==
-----END CERTIFICATE-----";

/// <summary>
/// CSR raw text.
/// </summary>
public const string CertificateSigningRequest = @"-----BEGIN CERTIFICATE REQUEST-----
/// <summary>
/// CSR raw text.
/// </summary>
public const string CertificateSigningRequest = @"-----BEGIN CERTIFICATE REQUEST-----
MIICyDCCAa8CAQAwgYAxCzAJBgNVBAYTAnVzMREwDwYDVQQIDAhOZXcgWW9yazEP
MA0GA1UECgwGSml0Yml0MSAwHgYDVQQDDBdhc3BuZXRzYW1sLmppdGJpdC5sb2Nh
bDEWMBQGA1UEBwwNTmV3IFlvcmsgQ2l0eTETMBEGA1UECwwKQXNwTmV0U2FtbDCC
Expand All @@ -99,9 +99,9 @@ public static class Certificates
t9RbkNHiT5rwOlSe3b86oonejHDEj4RDVNr89/6LJ3KxAsL5bUGCJaQbhWU=
-----END CERTIFICATE REQUEST-----";

/// <summary>
/// Test certificate instance.
/// </summary>
public static X509Certificate2 Certificate => new Lazy<X509Certificate2>(() => X509Certificate2.CreateFromPem(PublicCertificate, PrivateKey)).Value;
}
/// <summary>
/// Test certificate instance.
/// </summary>
public static X509Certificate2 Certificate => new Lazy<X509Certificate2>(() => X509Certificate2.CreateFromPem(PublicCertificate, PrivateKey)).Value;
}
}
Loading

0 comments on commit 0c6890e

Please sign in to comment.