Skip to content

Commit

Permalink
Minor clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeLeithead committed Jul 22, 2024
1 parent 323e855 commit ab43559
Show file tree
Hide file tree
Showing 10 changed files with 2,413 additions and 2,326 deletions.
170 changes: 170 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# Suppress: EC112
# top-most EditorConfig file
root = true

# Default settings:
# A newline ending every file
# Use 4 spaces as indentation
[*]
insert_final_newline = false
indent_style = space
indent_size = 4

# Code files
[*.{cs,csx,vb,vbx}]
indent_style = tab
indent_size = 4
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 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_prefer_collection_expression = 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

# Code files

# IDE0040: Add accessibility modifiers
dotnet_diagnostic.IDE0040.severity = none

[*.sln]
indent_size = 4

# Xml project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# Xml config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2

# JSON files
[*.json]
indent_size = 2

# XML files
[*.xml]
indent_size = 2

[*.cs]

# Organize usings
dotnet_sort_system_directives_first = true

# IDE0160: Use file scoped namespace
csharp_style_namespace_declarations = file_scoped:error

# CS4014: Because this call is not awaited, execution of the current method continues before the call is completed
dotnet_diagnostic.CS4014.severity = error

# Remove explicit default access modifiers
dotnet_style_require_accessibility_modifiers = omit_if_default:none

# CA1063: Implement IDisposable Correctly
dotnet_diagnostic.CA1063.severity = error

# CA1001: Type owns disposable field(s) but is not disposable
dotnet_diagnostic.CA1001.severity = error

# Add braces (IDE0011)
csharp_prefer_braces = true:silent
dotnet_diagnostic.IDE0011.severity = error

# Pattern matching
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method=true:suggestion

csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion

# Naming rules

dotnet_diagnostic.IDE1006.severity = error

## Public Fields are kept Pascal Case
dotnet_naming_symbols.public_symbols.applicable_kinds = field
dotnet_naming_symbols.public_symbols.applicable_accessibilities = public, internal

dotnet_naming_style.first_word_upper_case_style.capitalization = first_word_upper

dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols
dotnet_naming_rule.public_members_must_be_capitalized.style = first_word_upper_case_style
dotnet_naming_rule.public_members_must_be_capitalized.severity = suggestion

## Instance fields are camelCase
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = error
dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style

dotnet_naming_symbols.instance_fields.applicable_kinds = field

dotnet_naming_style.instance_field_style.capitalization = camel_case
dotnet_naming_style.instance_field_style.required_prefix =

## Static fields are camelCase
dotnet_naming_rule.static_fields_should_be_camel_case.severity = error
dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
dotnet_naming_rule.static_fields_should_be_camel_case.style = instance_field_style

dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected

dotnet_naming_style.static_field_style.capitalization = camel_case
dotnet_naming_style.static_field_style.required_prefix =

# Modifier preferences
csharp_prefer_static_local_function = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error

# CA1822: Member does not access instance data and can be marked as static
dotnet_diagnostic.CA1822.severity = suggestion

# CA1050: Declare types in namespaces
dotnet_diagnostic.CA1050.severity = error

# CA2016: Forward the 'cancellationToken' parameter methods that take one
dotnet_diagnostic.CA2016.severity = error

# CA1068: CancellationToken parameters must come last
dotnet_diagnostic.CA1068.severity = error

# CA2208: Method passes parameter as the paramName argument to a ArgumentNullException constructor. Replace this argument with one of the method's parameter names. Note that the provided parameter name should have the exact casing as declared on the method.
dotnet_diagnostic.CA2208.severity = error

# CA1834: Use 'StringBuilder.Append(char)' instead of 'StringBuilder.Append(string)' when the input is a constant unit string
dotnet_diagnostic.CA1834.severity = error

# IDE0220: Add explicit cast
dotnet_diagnostic.IDE0220.severity = error
csharp_indent_labels = one_less_than_current
csharp_using_directive_placement = inside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
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 = true:silent
csharp_style_expression_bodied_constructors = true:silent
csharp_style_expression_bodied_operators = true: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 = true:silent
8 changes: 4 additions & 4 deletions Source/LiLo.Lite.UITest/LiLo.Lite.UITest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
<Version>7.2.0.564</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms">
<Version>5.0.0.2515</Version>
<Version>5.0.0.2662</Version>
</PackageReference>
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="Xamarin.UITest" Version="3.2.8" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1">
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="Xamarin.UITest" Version="4.3.7" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
8 changes: 4 additions & 4 deletions Source/LiLo.Lite/LiLo.Lite.Android/LiLo.Lite.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@
<Version>7.2.0.564</Version>
</PackageReference>
<PackageReference Include="Microsoft.AppCenter.Analytics">
<Version>4.5.3</Version>
<Version>5.0.5</Version>
</PackageReference>
<PackageReference Include="Microsoft.AppCenter.Crashes">
<Version>4.5.3</Version>
<Version>5.0.5</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2515" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.3" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2662" />
<PackageReference Include="Xamarin.Essentials" Version="1.8.1" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand Down
Loading

0 comments on commit ab43559

Please sign in to comment.