Skip to content

Commit

Permalink
Update code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJoeFin committed Sep 19, 2024
1 parent 4da3a99 commit 8e7ee43
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 37 deletions.
101 changes: 76 additions & 25 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
# EditorConfig is awesome: https://EditorConfig.org

# Remove the line below if you want to inherit '.editorconfig' settings from higher directories
root = true

[*]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
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

[*.{yml,yaml,appxmanifest,manifest,config}]
indent_style = space
indent_size = 2

# Files that require CRLF line endings
[*.{bat,cmd,wapproj}]
end_of_line = crlf
indent_style = space
indent_size = 4

[*.{sln,props}]
indent_style = tab
indent_size = 8

# C# files
[*.cs]

Expand All @@ -13,7 +43,6 @@ tab_width = 4

# New line preferences
end_of_line = crlf
insert_final_newline = false

#### .NET Coding Conventions ####

Expand Down Expand Up @@ -82,14 +111,14 @@ csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = false:suggestion

# Expression-bodied members
csharp_style_expression_bodied_accessors = true
csharp_style_expression_bodied_constructors = false
csharp_style_expression_bodied_indexers = true
csharp_style_expression_bodied_lambdas = true
csharp_style_expression_bodied_local_functions = false
csharp_style_expression_bodied_methods = false
csharp_style_expression_bodied_operators = false
csharp_style_expression_bodied_properties = true
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent

# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true
Expand All @@ -109,12 +138,12 @@ csharp_style_prefer_readonly_struct = true
csharp_style_prefer_readonly_struct_member = true

# Code-block preferences
csharp_prefer_braces = when_multiline
csharp_prefer_simple_using_statement = true
csharp_style_namespace_declarations = file_scoped
csharp_style_prefer_method_group_conversion = true
csharp_style_prefer_primary_constructors = true
csharp_style_prefer_top_level_statements = true
csharp_prefer_braces = when_multiline:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = file_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_prefer_top_level_statements = true:silent

# Expression-level preferences
csharp_prefer_simple_default_expression = true
Expand All @@ -132,7 +161,7 @@ csharp_style_unused_value_assignment_preference = discard_variable
csharp_style_unused_value_expression_statement_preference = discard_variable

# 'using' directive preferences
csharp_using_directive_placement = outside_namespace
csharp_using_directive_placement = outside_namespace:silent

# New line preferences
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
Expand Down Expand Up @@ -208,24 +237,46 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

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.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.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 =
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

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.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.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.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_diagnostic.CA1069.severity = none # CA1069: Enums values should not be duplicated
dotnet_diagnostic.CA2211.severity = none
dotnet_diagnostic.CA1806.severity = none
dotnet_diagnostic.CA1016.severity = none
dotnet_diagnostic.CA1806.severity = none
dotnet_diagnostic.CA1822.severity = none
dotnet_diagnostic.CA1845.severity = none
dotnet_diagnostic.CA1513.severity = none
dotnet_diagnostic.CA1859.severity = none
dotnet_diagnostic.CA1854.severity = none
dotnet_diagnostic.NU1503.severity = none
dotnet_diagnostic.CA1869.severity = none
dotnet_diagnostic.CA1067.severity = none
dotnet_diagnostic.IDE0011.severity = none
dotnet_diagnostic.IDE0060.severity = none
dotnet_diagnostic.IDE0059.severity = none
dotnet_diagnostic.IDE0055.severity = none
dotnet_diagnostic.CA2263.severity = none
dotnet_diagnostic.IDE0051.severity = none
dotnet_diagnostic.IDE0052.severity = none
dotnet_diagnostic.CS1591.severity = none
9 changes: 2 additions & 7 deletions Tests/FilesIoTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using Text_Grab;
using Text_Grab.Utilities;

Expand All @@ -16,7 +11,7 @@ public class FilesIoTests
[WpfFact]
public async Task CanSaveImagesWithHistory()
{
Bitmap fontSampleBitmap = new Bitmap(FileUtilities.GetPathToLocalFile(fontSamplePath));
Bitmap fontSampleBitmap = new(FileUtilities.GetPathToLocalFile(fontSamplePath));

bool couldSave = await FileUtilities.SaveImageFile(fontSampleBitmap, "newTest.png", FileStorageKind.WithHistory);

Expand Down
4 changes: 2 additions & 2 deletions Tests/OcrTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ public async Task GetTessLanguages()
Assert.Contains(tag, actualStrings);
}
}
[WpfFact(Skip ="fails GitHub actions")]

[WpfFact(Skip = "fails GitHub actions")]
public async Task GetTesseractStrongLanguages()
{
List<ILanguage> expectedList = new()
Expand Down
2 changes: 1 addition & 1 deletion Tests/QrCodeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class QrCodeTests
public void generateSvgImage()
{
string testString = "This is only a test";
var svg = BarcodeUtilities.GetSvgQrCodeForText(testString, ErrorCorrectionLevel.L);
ZXing.Rendering.SvgRenderer.SvgImage svg = BarcodeUtilities.GetSvgQrCodeForText(testString, ErrorCorrectionLevel.L);

Assert.NotNull(svg);
}
Expand Down
3 changes: 1 addition & 2 deletions Tests/StringMethodTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Text;
using Text_Grab;
using System.Linq;
using Text_Grab.Utilities;

namespace Tests;
Expand Down Expand Up @@ -95,7 +94,7 @@ public void TryFixToLetters_ReplacesDigitsWithLetters_AsExpected(string input, s
}

[Theory]
[InlineData("","")]
[InlineData("", "")]
[InlineData("he11o there", "hello there")]
[InlineData("my number is l23456789o", "my number is 1234567890")]
public void TryFixNumOrLetters(string input, string expected)
Expand Down

0 comments on commit 8e7ee43

Please sign in to comment.