Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaned all warnings in Core, .Blazor project + minor suggestions #62

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ 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_coalesce_expression = false: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:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion
dotnet_style_prefer_conditional_expression_over_return = false:suggestion
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
Expand All @@ -69,6 +69,9 @@ dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
dotnet_style_namespace_match_folder = true:suggestion
indent_style = tab

# Code Quality
dotnet_code_quality.CA1826.exclude_ordefault_methods = true

[*.cs]
csharp_indent_labels = one_less_than_current
csharp_space_around_binary_operators = before_and_after
Expand All @@ -78,7 +81,7 @@ 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_prefer_primary_constructors = false:suggestion
csharp_prefer_system_threading_lock = true:suggestion
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
Expand Down
6 changes: 3 additions & 3 deletions src/NodeDev.Blazor/Components/ClassExplorer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@
}).Result;

NodeDev.Core.Types.TypeBase typeBase;
if (result.Data is Type type)
if (result?.Data is Type type)
typeBase = Class.TypeFactory.Get(type, null);
else if (result.Data is NodeDev.Core.Types.TypeBase t)
else if (result?.Data is NodeDev.Core.Types.TypeBase t)
typeBase = t;
else
return;
Expand Down Expand Up @@ -234,7 +234,7 @@
{
if (CurrentlyEditingItem!.Type == TreeItemType.Method)
{
var method = new Core.Class.NodeClassMethod(Class, Text, Class.TypeFactory.Get(typeof(void), null), new Core.Graph());
var method = new Core.Class.NodeClassMethod(Class, Text, Class.TypeFactory.Get(typeof(void), null));
Class.AddMethod(method, createEntryAndReturn: true);

Items.First(x => x.Value!.Type == TreeItemType.MethodsFolder).Children!.RemoveAll(x => x.Value == CurrentlyEditingItem);
Expand Down
2 changes: 2 additions & 0 deletions src/NodeDev.Blazor/Components/DebuggerConsolePanel.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ private void AddText(string text)

public void Dispose()
{
GC.SuppressFinalize(this);

GraphExecutionChangedDisposable?.Dispose();
RefreshRequiredDisposable?.Dispose();

Expand Down
8 changes: 4 additions & 4 deletions src/NodeDev.Blazor/Components/EditMethodMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
</CellTemplate>
</TemplateColumn>

<CallbackSetColumn Property="x => x.Name" SetCallback="(x, name) => x.Rename(name)" IsEditable="true" />
<CallbackSetColumn Property="x => x.Name" SetCallback="(x, name) => x.Rename(name)" Editable="true" />

<TemplateColumn Title="IsOut">
<EditTemplate>
<MudCheckBox T="bool" Value="context.Item?.IsOut ?? false" ValueChanged="@(v => context.Item?.SetIsOut(v))"></MudCheckBox>
</EditTemplate>
</TemplateColumn>

<TemplateColumn IsEditable="false">
<TemplateColumn Editable="false">

<CellTemplate>

Expand Down Expand Up @@ -73,9 +73,9 @@
}).Result;

NodeDev.Core.Types.TypeBase typeBase;
if (result.Data is Type type)
if (result?.Data is Type type)
typeBase = Method.Class.TypeFactory.Get(type, null);
else if (result.Data is NodeDev.Core.Types.TypeBase t)
else if (result?.Data is NodeDev.Core.Types.TypeBase t)
typeBase = t;
else
return;
Expand Down
Loading
Loading