Skip to content

Commit

Permalink
Merge pull request #119 from atc-net/feature/maintenance
Browse files Browse the repository at this point in the history
Feature/maintenance
  • Loading branch information
davidkallesen authored Apr 7, 2024
2 parents 0274857 + 3f1fbce commit 0c024aa
Show file tree
Hide file tree
Showing 31 changed files with 180 additions and 41 deletions.
23 changes: 20 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 25-09-2023
# Location: Root
Expand Down Expand Up @@ -87,6 +87,7 @@ dotnet_separate_import_directive_groups = false
# .NET Code Style Settings
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings
[*.{cs,csx,cake}]

# "this." and "Me." qualifiers
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me
dotnet_style_qualification_for_field = false
Expand Down Expand Up @@ -146,12 +147,17 @@ dotnet_style_operator_placement_when_wrapping = end_of_line
# C# Code Style Settings
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-code-style-settings
[*.{cs,csx,cake}]

# Implicit and explicit types
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types
csharp_style_var_for_built_in_types = true # IDE0007 and IDE0008
csharp_style_var_when_type_is_apparent = true # IDE0007 and IDE0008
csharp_style_var_elsewhere = true # IDE0007 and IDE0008

# Namespace declaration preferences
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0160-ide0161?view=vs-2022
csharp_style_namespace_declarations = file_scoped # IDE0160 and IDE0161

# Expression-bodied members
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members
csharp_style_expression_bodied_constructors = when_on_single_line # IDE0021
Expand Down Expand Up @@ -195,8 +201,8 @@ csharp_style_unused_value_assignment_preference = discard_variable

# Index and range preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences
csharp_style_prefer_index_operator = true # IDE0056
csharp_style_prefer_range_operator = true # IDE0057
csharp_style_prefer_index_operator = true:suggestion # IDE0056
csharp_style_prefer_range_operator = true:suggestion # IDE0057

# Miscellaneous preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences
Expand Down Expand Up @@ -444,19 +450,25 @@ dotnet_naming_rule.parameters_rule.severity = warning
dotnet_diagnostic.MA0003.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0003.md
dotnet_diagnostic.MA0004.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0004.md
dotnet_diagnostic.MA0006.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0006.md
dotnet_diagnostic.MA0011.severity = none # Duplicate of CA1305
dotnet_diagnostic.MA0016.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0016.md
dotnet_diagnostic.MA0025.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0025.md
dotnet_diagnostic.MA0026.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0026.md
dotnet_diagnostic.MA0028.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0028.md
dotnet_diagnostic.MA0038.severity = none # Duplicate of CA1822
dotnet_diagnostic.MA0048.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/Meziantou/MA0048.md


# Microsoft - Code Analysis
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
dotnet_diagnostic.CA1014.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1014.md
dotnet_diagnostic.CA1068.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1068.md
dotnet_diagnostic.CA1305.severity = error
dotnet_diagnostic.CA1707.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA1707.md
dotnet_diagnostic.CA1812.severity = none
dotnet_diagnostic.CA1822.severity = suggestion
dotnet_diagnostic.CA2007.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md
dotnet_diagnostic.IDE0005.severity = warning # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0005.md
dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md


Expand All @@ -481,6 +493,7 @@ dotnet_diagnostic.SA1202.severity = none # https://github.com/atc-net
dotnet_diagnostic.SA1204.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1204.md
dotnet_diagnostic.SA1413.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1413.md
dotnet_diagnostic.SA1600.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1600.md
dotnet_diagnostic.SA1601.severity = none
dotnet_diagnostic.SA1602.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1602.md
dotnet_diagnostic.SA1604.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1604.md
dotnet_diagnostic.SA1623.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1623.md
Expand All @@ -492,6 +505,10 @@ dotnet_diagnostic.SA1649.severity = error # https://github.com/atc-net
# SonarAnalyzer.CSharp
# https://rules.sonarsource.com/csharp
dotnet_diagnostic.S1135.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/SonarAnalyzerCSharp/S1135.md
dotnet_diagnostic.S2629.severity = none # Don't use string interpolation in logging message templates.
dotnet_diagnostic.S6602.severity = none # "Find" method should be used instead of the "FirstOrDefault"
dotnet_diagnostic.S6603.severity = none # The collection-specific "TrueForAll" method should be used instead of the "All"
dotnet_diagnostic.S6605.severity = none # Collection-specific "Exists" method should be used instead of the "Any"


##########################################
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/post-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: windows-latest
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT_WORKFLOWS }}
Expand All @@ -31,7 +31,7 @@ jobs:
setAllVars: true

- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pre-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: windows-latest
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

Expand All @@ -37,12 +37,12 @@ jobs:
- dotnet-build
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: windows-latest
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT_WORKFLOWS }}
Expand All @@ -28,7 +28,7 @@ jobs:
setAllVars: true

- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
<ItemGroup Label="Code Analyzers">
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
<PackageReference Include="Asyncify" Version="0.9.7" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.145" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.146" PrivateAssets="All" />
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.20.0.85982" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.1.88495" PrivateAssets="All" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion atc-coding-rules-updater.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ atc-coding-rules-updater `
run `
-p $currentPath `
--optionsPath $currentPath'\atc-coding-rules-updater.json' `
-v
--verbose
17 changes: 17 additions & 0 deletions sample/Atc.Wpf.Sample/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 27-03-2024
# Location: wpf
# Distribution: Frameworks

##########################################
# Code Analyzers Rules
##########################################
[*.{cs}]

dotnet_diagnostic.MA0004.severity = error # Use Task.ConfigureAwait(false) https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md
dotnet_diagnostic.MA0048.severity = none # To support partial classes - File will not match type name.

##########################################
# Custom - Code Analyzers Rules
##########################################
2 changes: 1 addition & 1 deletion sample/Atc.Wpf.Sample/Atc.Wpf.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.433" />
<PackageReference Include="Atc" Version="2.0.462" />
<PackageReference Include="ControlzEx" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
Expand Down
17 changes: 17 additions & 0 deletions src/Atc.Wpf.Controls.Sample/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 27-03-2024
# Location: wpf
# Distribution: Frameworks

##########################################
# Code Analyzers Rules
##########################################
[*.{cs}]

dotnet_diagnostic.MA0004.severity = error # Use Task.ConfigureAwait(false) https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md
dotnet_diagnostic.MA0048.severity = none # To support partial classes - File will not match type name.

##########################################
# Custom - Code Analyzers Rules
##########################################
2 changes: 1 addition & 1 deletion src/Atc.Wpf.Controls.Sample/Atc.Wpf.Controls.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.433" />
<PackageReference Include="Atc" Version="2.0.462" />
<PackageReference Include="MdXaml" Version="1.27.0" />
</ItemGroup>

Expand Down
17 changes: 17 additions & 0 deletions src/Atc.Wpf.Controls/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 27-03-2024
# Location: wpf
# Distribution: Frameworks

##########################################
# Code Analyzers Rules
##########################################
[*.{cs}]

dotnet_diagnostic.MA0004.severity = error # Use Task.ConfigureAwait(false) https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md
dotnet_diagnostic.MA0048.severity = none # To support partial classes - File will not match type name.

##########################################
# Custom - Code Analyzers Rules
##########################################
3 changes: 2 additions & 1 deletion src/Atc.Wpf.Controls/Atc.Wpf.Controls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.433" />
<PackageReference Include="Atc" Version="2.0.462" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Atc.Wpf.Controls/BaseControls/ToggleSwitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ private void OnSwitchThumbDragDelta(
DragDeltaEventArgs e)
{
e.Handled = true;
if (e.HorizontalChange == 0)
if (e.HorizontalChange.IsZero())
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Atc.Wpf.Controls/ColorControls/HueSlider.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private void UpdateAdorner(

// Make it so that the arrow doesn't jump back to the top when it goes to the bottom
var mousePos = Mouse.GetPosition(this);
if (percent == 0 && ActualHeight - mousePos.Y < 1)
if (percent.IsZero() && ActualHeight - mousePos.Y < 1)
{
percent = 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private static IList<ILabelControlBase> ExtractType<T>(
propertyInfo.PropertyType == typeof(DateTimeOffset) ||
propertyInfo.PropertyType == typeof(DateTimeOffset?))
{
Trace.WriteLine($"ModelToLabelControlHelper is not supporting dataType yet: {propertyInfo.PropertyType}");
Trace.TraceWarning($"ModelToLabelControlHelper is not supporting dataType yet: {propertyInfo.PropertyType}");
continue;
}

Expand All @@ -80,7 +80,7 @@ private static IList<ILabelControlBase> ExtractType<T>(
continue;
}

Trace.WriteLine($"ModelToLabelControlHelper is not supporting dataType yet: {propertyInfo.PropertyType}");
Trace.TraceWarning($"ModelToLabelControlHelper is not supporting dataType yet: {propertyInfo.PropertyType}");
}

return labelControls;
Expand Down
17 changes: 17 additions & 0 deletions src/Atc.Wpf.FontIcons/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 27-03-2024
# Location: wpf
# Distribution: Frameworks

##########################################
# Code Analyzers Rules
##########################################
[*.{cs}]

dotnet_diagnostic.MA0004.severity = error # Use Task.ConfigureAwait(false) https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md
dotnet_diagnostic.MA0048.severity = none # To support partial classes - File will not match type name.

##########################################
# Custom - Code Analyzers Rules
##########################################
17 changes: 17 additions & 0 deletions src/Atc.Wpf.Theming/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 27-03-2024
# Location: wpf
# Distribution: Frameworks

##########################################
# Code Analyzers Rules
##########################################
[*.{cs}]

dotnet_diagnostic.MA0004.severity = error # Use Task.ConfigureAwait(false) https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md
dotnet_diagnostic.MA0048.severity = none # To support partial classes - File will not match type name.

##########################################
# Custom - Code Analyzers Rules
##########################################
2 changes: 1 addition & 1 deletion src/Atc.Wpf.Theming/Atc.Wpf.Theming.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.433" />
<PackageReference Include="Atc" Version="2.0.462" />
<PackageReference Include="ControlzEx" version="6.0.0" />

<!-- Uncomment XAMLTools.MSBuild to run Tool for generating Themes-xaml files -->
Expand Down
17 changes: 17 additions & 0 deletions src/Atc.Wpf/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 27-03-2024
# Location: wpf
# Distribution: Frameworks

##########################################
# Code Analyzers Rules
##########################################
[*.{cs}]

dotnet_diagnostic.MA0004.severity = error # Use Task.ConfigureAwait(false) https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md
dotnet_diagnostic.MA0048.severity = none # To support partial classes - File will not match type name.

##########################################
# Custom - Code Analyzers Rules
##########################################
2 changes: 1 addition & 1 deletion src/Atc.Wpf/Atc.Wpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.433" />
<PackageReference Include="Atc" Version="2.0.462" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void Normalize()
scale = X2;
}

if (scale != 0)
if (!scale.IsZero())
{
X1 /= scale;
X2 /= scale;
Expand All @@ -119,11 +119,13 @@ private void Normalize()
scale = Y2;
}

if (scale != 0)
if (scale.IsZero())
{
Y1 /= scale;
Y2 /= scale;
return;
}

Y1 /= scale;
Y2 /= scale;
}
}

Expand Down
Loading

0 comments on commit 0c024aa

Please sign in to comment.