Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jerviscui committed May 27, 2024
1 parent 22a84ff commit 16d8945
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.severity
# All static readonly fields must be PascalCase
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1311.md
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private
dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static, readonly
# dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static, readonly
dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_kinds = field
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.symbols = stylecop_static_readonly_fields_group
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style
Expand Down Expand Up @@ -425,9 +426,9 @@ dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.severity = s
# Second, it helps to raise immediate awareness if a new field type is added (as occurred recently in C#).
dotnet_naming_symbols.sanity_check_uncovered_field_case_group.applicable_accessibilities = *
dotnet_naming_symbols.sanity_check_uncovered_field_case_group.applicable_kinds = field
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.symbols = sanity_check_uncovered_field_case_group
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.style = internal_error_style
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.severity = error
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.symbols = sanity_check_uncovered_field_case_group
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.style = internal_error_style
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.severity = error

#### Other Naming Rules ####

Expand Down
30 changes: 30 additions & 0 deletions src/Tests/CodeAnalysisTest/OrganizeMembersTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,44 @@ public OrganizeMembersTest(bool boolProp, string strProp, int myField)
_boolProp = boolProp;
_strProp = strProp;
_myField = myField;

_field1 = 0;
_field2 = 0;
}

// Field3
private static readonly int Field3 = 1;
private int _field1;
private static string Field4 = string.Empty;
/// <summary>
/// Skip initialized fields
/// </summary>
private const string Const2 = "My Model";
// one line comment
private const int Const1 = 140;


/// <inheritdoc/>
public Task TaskMethodAsync(CancellationToken cancellationToken)
{
throw new NotImplementedException();
}

private void MethodName()
{
Console.WriteLine(_field1);
Console.WriteLine(_field2);
Console.WriteLine(Field3);
Console.WriteLine(Field4);

throw new NotImplementedException();
}
/// <summary>
/// The field2
/// </summary>
private int _field2;


Task IImplicit.TaskMethodAsync(CancellationToken cancellationToken)
{
throw new NotImplementedException();
Expand Down

0 comments on commit 16d8945

Please sign in to comment.