Skip to content

Commit

Permalink
chore: Nuget update and coding-rules
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkallesen committed Jun 11, 2024
1 parent 435e209 commit 85f210e
Show file tree
Hide file tree
Showing 21 changed files with 106 additions and 45 deletions.
39 changes: 37 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 25-09-2023
# Version: 1.0.1
# Updated: 03-06-2024
# Location: Root
# Distribution: DotNet8
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
Expand Down Expand Up @@ -464,10 +464,45 @@ dotnet_diagnostic.MA0048.severity = error # https://github.com/atc-net
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.CA1510.severity = suggestion # Use ArgumentNullException throw helper
dotnet_diagnostic.CA1511.severity = suggestion # Use ArgumentException throw helper
dotnet_diagnostic.CA1512.severity = suggestion # Use ArgumentOutOfRangeException throw helper
dotnet_diagnostic.CA1513.severity = suggestion # Use ObjectDisposedException throw helper
dotnet_diagnostic.CA1514.severity = error # Avoid redundant length argument
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.CA1849.severity = error # Call async methods when in an async method
dotnet_diagnostic.CA1854.severity = suggestion # Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method
dotnet_diagnostic.CA1855.severity = suggestion # Prefer 'Clear' over 'Fill'
dotnet_diagnostic.CA1856.severity = error # Incorrect usage of ConstantExpected attribute
dotnet_diagnostic.CA1857.severity = suggestion # A constant is expected for the parameter
dotnet_diagnostic.CA1858.severity = suggestion # Use 'StartsWith' instead of 'IndexOf'
dotnet_diagnostic.CA1859.severity = suggestion # Use concrete types when possible for improved performance
dotnet_diagnostic.CA1860.severity = suggestion # Avoid using 'Enumerable.Any()' extension method
dotnet_diagnostic.CA1861.severity = suggestion # Avoid constant arrays as arguments
dotnet_diagnostic.CA1862.severity = error # Use the 'StringComparison' method overloads to perform case-insensitive string comparisons
dotnet_diagnostic.CA1863.severity = suggestion # Use 'CompositeFormat'
dotnet_diagnostic.CA1864.severity = suggestion # Prefer the 'IDictionary.TryAdd(TKey, TValue)' method
dotnet_diagnostic.CA1865.severity = suggestion # Use char overload
dotnet_diagnostic.CA1866.severity = suggestion # Use char overload
dotnet_diagnostic.CA1867.severity = suggestion # Use char overload
dotnet_diagnostic.CA1868.severity = suggestion # Unnecessary call to 'Contains(item)'
dotnet_diagnostic.CA1869.severity = suggestion # Cache and reuse 'JsonSerializerOptions' instances
dotnet_diagnostic.CA1870.severity = suggestion # Use a cached 'SearchValues' instance
dotnet_diagnostic.CA2007.severity = suggestion # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/CA2007.md
dotnet_diagnostic.CA2017.severity = error # Parameter count mismatch
dotnet_diagnostic.CA2018.severity = error # The count argument to Buffer.BlockCopy should specify the number of bytes to copy
dotnet_diagnostic.CA2019.severity = error # ThreadStatic fields should not use inline initialization
dotnet_diagnostic.CA2021.severity = error # Don't call Enumerable.Cast<T> or Enumerable.OfType<T> with incompatible types
dotnet_diagnostic.CA2250.severity = suggestion # Use ThrowIfCancellationRequested
dotnet_diagnostic.CA2252.severity = suggestion # Opt-in to preview features should be used with caution
dotnet_diagnostic.CA2253.severity = error # Named placeholders should not be numeric values
dotnet_diagnostic.CA2254.severity = suggestion # Template should be a static expression
dotnet_diagnostic.CA2255.severity = suggestion # The ModuleInitializer attribute should not be used in libraries
dotnet_diagnostic.CA2259.severity = error # Ensure ThreadStatic is only used with static fields
dotnet_diagnostic.CA2260.severity = error # Implement generic math interfaces correctly
dotnet_diagnostic.CA2261.severity = error # Do not use ConfigureAwaitOptions.SuppressThrowing with Task<TResult>
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 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.149" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.155" 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.24.0.89429" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.27.0.93347" PrivateAssets="All" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions sample/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
# StyleCop
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers

# SonarAnalyzer.CSharp
# https://rules.sonarsource.com/csharp

dotnet_diagnostic.S1075.severity = none # Refactor your code not to use hardcoded absolute paths or URIs


##########################################
# Custom - Code Analyzers Rules
Expand Down
7 changes: 5 additions & 2 deletions sample/Atc.Wpf.Sample/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 27-03-2024
# Version: 1.0.1
# Updated: 06-06-2024
# Location: wpf
# Distribution: Frameworks

Expand All @@ -12,6 +12,9 @@
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.

dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227


##########################################
# 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.472" />
<PackageReference Include="Atc" Version="2.0.478" />
<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
7 changes: 5 additions & 2 deletions src/Atc.Wpf.Controls.Sample/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 27-03-2024
# Version: 1.0.1
# Updated: 06-06-2024
# Location: wpf
# Distribution: Frameworks

Expand All @@ -12,6 +12,9 @@
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.

dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227


##########################################
# 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.472" />
<PackageReference Include="Atc" Version="2.0.478" />
<PackageReference Include="MdXaml" Version="1.27.0" />
</ItemGroup>

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

Expand All @@ -12,6 +12,9 @@
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.

dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227


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

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.472" />
<PackageReference Include="Atc" Version="2.0.478" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

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

Expand All @@ -12,6 +12,9 @@
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.

dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227


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

Expand All @@ -12,6 +12,9 @@
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.

dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227


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

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.472" />
<PackageReference Include="Atc" Version="2.0.478" />
<PackageReference Include="ControlzEx" version="6.0.0" />

<!-- Uncomment XAMLTools.MSBuild to run Tool for generating Themes-xaml files -->
<!--<PackageReference Include="XAMLTools.MSBuild" Version="1.0.0-alpha0143" PrivateAssets="all" IncludeAssets="build" />-->

<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.2.10-beta">
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
8 changes: 4 additions & 4 deletions src/Atc.Wpf.Theming/Controls/Windows/WindowSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ internal WINDOWPLACEMENT ToWindowPlacement()
{
length = (uint)Marshal.SizeOf<WINDOWPLACEMENT>(),
showCmd = (SHOW_WINDOW_CMD)showCmd,
ptMinPosition = new POINT { x = (int)minPosition.X, y = (int)minPosition.Y },
ptMaxPosition = new POINT { x = (int)maxPosition.X, y = (int)maxPosition.Y },
ptMinPosition = new System.Drawing.Point { X = (int)minPosition.X, Y = (int)minPosition.Y },
ptMaxPosition = new System.Drawing.Point { X = (int)maxPosition.X, Y = (int)maxPosition.Y },
rcNormalPosition = new RECT
{
left = (int)normalPosition.X,
Expand All @@ -38,8 +38,8 @@ internal static WindowPlacementSetting FromWindowPlacement(WINDOWPLACEMENT windo
return new WindowPlacementSetting
{
showCmd = (uint)windowPlacement.showCmd,
minPosition = new Point(windowPlacement.ptMinPosition.x, windowPlacement.ptMinPosition.y),
maxPosition = new Point(windowPlacement.ptMaxPosition.x, windowPlacement.ptMaxPosition.y),
minPosition = new Point(windowPlacement.ptMinPosition.X, windowPlacement.ptMinPosition.Y),
maxPosition = new Point(windowPlacement.ptMaxPosition.X, windowPlacement.ptMaxPosition.Y),
normalPosition = new Rect(
windowPlacement.rcNormalPosition.left,
windowPlacement.rcNormalPosition.top,
Expand Down
7 changes: 5 additions & 2 deletions src/Atc.Wpf/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 27-03-2024
# Version: 1.0.1
# Updated: 06-06-2024
# Location: wpf
# Distribution: Frameworks

Expand All @@ -12,6 +12,9 @@
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.

dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227


##########################################
# 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.472" />
<PackageReference Include="Atc" Version="2.0.478" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.139" PrivateAssets="All" />
</ItemGroup>

</Project>
10 changes: 5 additions & 5 deletions test/Atc.Wpf.Controls.Tests/Atc.Wpf.Controls.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.472" />
<PackageReference Include="Atc.XUnit" Version="2.0.472" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PackageReference Include="Atc" Version="2.0.478" />
<PackageReference Include="Atc.XUnit" Version="2.0.478" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
10 changes: 5 additions & 5 deletions test/Atc.Wpf.Tests/Atc.Wpf.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.472" />
<PackageReference Include="Atc.XUnit" Version="2.0.472" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PackageReference Include="Atc" Version="2.0.478" />
<PackageReference Include="Atc.XUnit" Version="2.0.478" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
10 changes: 5 additions & 5 deletions test/Atc.Wpf.Theming.Tests/Atc.Wpf.Theming.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.472" />
<PackageReference Include="Atc.XUnit" Version="2.0.472" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PackageReference Include="Atc" Version="2.0.478" />
<PackageReference Include="Atc.XUnit" Version="2.0.478" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
7 changes: 5 additions & 2 deletions tool/Atc.Wpf.Generator.FontIconResources/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 27-03-2024
# Version: 1.0.1
# Updated: 06-06-2024
# Location: wpf
# Distribution: Frameworks

Expand All @@ -12,6 +12,9 @@
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.

dotnet_diagnostic.CA2227.severity = none # Change property to be read-only by removing the property setter - https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2227


##########################################
# Custom - Code Analyzers Rules
##########################################
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.472" />
<PackageReference Include="Atc" Version="2.0.478" />
<PackageReference Include="ControlzEx" Version="6.0.0" />
<PackageReference Include="CssParser" Version="1.3.0">
<NoWarn>NU1701</NoWarn>
Expand Down

0 comments on commit 85f210e

Please sign in to comment.