Skip to content

Feature/move some logic to atc.wpf.controls #23

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

Merged
merged 9 commits into from
Apr 30, 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
17 changes: 12 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -201,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 @@ -450,18 +450,23 @@ 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 @@ -488,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 @@ -499,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 All @@ -525,11 +535,8 @@ dotnet_diagnostic.IDE0079.severity = none # dotnet_remove_unnecessary_

dotnet_diagnostic.MA0134.severity = none # Observe result of async calls

dotnet_diagnostic.S2629.severity = none # Don't use string interpolation in logging message templates.
dotnet_diagnostic.S3267.severity = none # Loops should be simplified with 'LINQ' expressions
dotnet_diagnostic.S4487.severity = none # Remove this unread private field
dotnet_diagnostic.S6602.severity = none # "Find" method should be used instead of the "FirstOrDefault"
dotnet_diagnostic.S6605.severity = none # Collection-specific "Exists" method should be used instead of the "Any"
dotnet_diagnostic.S6667.severity = none # Logging in a catch clause should pass the caught exception as a parameter.

dotnet_diagnostic.SCS0006.severity = none # Do Not Use Broken Cryptographic Algorithms - Its ok, only using to calculate a file-hash
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 @@ -42,12 +42,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 @@ -18,7 +18,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 @@ -32,7 +32,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 @@ -41,10 +41,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.150" 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.21.0.86780" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.24.0.89429" 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
16 changes: 16 additions & 0 deletions sample-projects/HelloWorld/Code/HelloWorldBlazor/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 27-03-2024
# Location: blazor
# Distribution: Frameworks

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

dotnet_diagnostic.MA0048.severity = none # To support code-behind [component].razor.cs files / Inherit from ComponentBase - File will not match type name.

##########################################
# Custom - Code Analyzers Rules
##########################################
14 changes: 14 additions & 0 deletions sample-projects/HelloWorld/Code/HelloWorldMaui/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.0
# Updated: 27-03-2024
# Location: maui
# Distribution: Frameworks

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

##########################################
# Custom - Code Analyzers Rules
##########################################
17 changes: 17 additions & 0 deletions sample-projects/HelloWorld/Code/HelloWorldWpf/.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
##########################################
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.433" />
<PackageReference Include="Azure.Identity" Version="1.10.4" />
<PackageReference Include="Atc" Version="2.0.472" />
<PackageReference Include="Azure.Identity" Version="1.11.2" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.19.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Atc" Version="2.0.433" />
<PackageReference Include="Atc" Version="2.0.472" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="8.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
</ItemGroup>

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

<ItemGroup>
<PackageReference Update="SonarAnalyzer.CSharp" Version="9.20.0.85982" />
<PackageReference Include="Atc" Version="2.0.472" />
</ItemGroup>

</Project>
45 changes: 8 additions & 37 deletions src/Atc.Installer.Wpf.App/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,45 +1,16 @@
# ATC coding rules - https://github.com/atc-net/atc-coding-rules
# Version: 1.0.9
# Updated: 24-11-2022
# Location: src
# Distribution: DotNet7
# Inspired by: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options
# Version: 1.0.0
# Updated: 27-03-2024
# Location: wpf
# Distribution: Frameworks

##########################################
# Code Analyzers Rules
##########################################
[*.{cs,csx,cake}]
[*.{cs}]

# AsyncFixer
# http://www.asyncfixer.com


# Asyncify
# https://github.com/hvanbakel/Asyncify-CSharp


# Meziantou
# https://www.meziantou.net/enforcing-asynchronous-code-good-practices-using-a-roslyn-analyzer.htm


# Microsoft - Code Analysis
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/


# Microsoft - Compiler Errors
# https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/


# SecurityCodeScan
# https://security-code-scan.github.io/


# StyleCop
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers


# SonarAnalyzer.CSharp
# https://rules.sonarsource.com/csharp
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.


##########################################
Expand All @@ -50,4 +21,4 @@ dotnet_diagnostic.CA1031.severity = none # Do not catch general e

dotnet_diagnostic.MA0049.severity = none # File should match

dotnet_diagnostic.S4487.severity = none # Remove unread private field
dotnet_diagnostic.S4487.severity = none # Remove unread private field
2 changes: 1 addition & 1 deletion src/Atc.Installer.Wpf.App/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ResourceDictionary Source="pack://application:,,,/Atc.Wpf.Controls;component/Styles/Controls.xaml" />
</ResourceDictionary.MergedDictionaries>

<Style BasedOn="{StaticResource AtcApps.Styles.MenuItem}" TargetType="MenuItem">
<Style BasedOn="{StaticResource AtcApps.Styles.MenuItem}" TargetType="{x:Type MenuItem}">
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
Expand Down
Loading
Loading