Skip to content
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
57 changes: 55 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,12 +464,58 @@ 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.CA1308.severity = suggestion # Normalize strings to uppercase
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.CA1515.severity = suggestion # Because an application's API isn't typically referenced from outside the assembly, types can be made internal (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1515)
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.IDE0010.severity = suggestion # Populate switch
dotnet_diagnostic.IDE0028.severity = suggestion # Collection initialization can be simplified
dotnet_diagnostic.IDE0021.severity = suggestion # Use expression body for constructor
dotnet_diagnostic.IDE0055.severity = none # Fix formatting
dotnet_diagnostic.IDE0058.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/MicrosoftCodeAnalysis/IDE0058.md
dotnet_diagnostic.IDE0061.severity = suggestion # Use expression body for local function
dotnet_diagnostic.IDE0130.severity = suggestion # Namespace does not match folder structure
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor
dotnet_diagnostic.IDE0301.severity = suggestion # Use collection expression for empty
dotnet_diagnostic.IDE0305.severity = suggestion # Collection initialization can be simplified


# Microsoft - Compiler Errors
Expand All @@ -484,6 +530,7 @@ dotnet_diagnostic.CS4014.severity = error # https://github.com/atc-net/
# StyleCop
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers
dotnet_diagnostic.SA1009.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1009.md
dotnet_diagnostic.SA1010.severity = none # False positive when using collection initializers
dotnet_diagnostic.SA1101.severity = none # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1101.md
dotnet_diagnostic.SA1122.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1122.md
dotnet_diagnostic.SA1133.severity = error # https://github.com/atc-net/atc-coding-rules/blob/main/documentation/CodeAnalyzersRules/StyleCop/SA1133.md
Expand All @@ -505,6 +552,11 @@ 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.S3358.severity = none # Extract this nested ternary operation into an independent statement.
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 @@ -529,6 +581,7 @@ dotnet_diagnostic.IDE0305.severity = suggestion # Collection initialization
dotnet_diagnostic.SA1010.severity = none #

dotnet_diagnostic.CA1054.severity = none # URI parameters should not be strings
dotnet_diagnostic.CA1308.severity = none # https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1308
dotnet_diagnostic.CA1515.severity = suggestion # Because an application's API isn't typically referenced from outside the assembly, types can be made internal (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1515)
dotnet_diagnostic.CA1848.severity = none # For improved performance, use the LoggerMessage delegates instead of calling 'LoggerExtensions.LogTrace(ILogger, string, params object[])'
dotnet_diagnostic.CA1859.severity = none #
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/atc-coding-rules-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
atc_check_for_updates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: '0'
- name: ⚙ set environment stuff
Expand All @@ -24,7 +24,7 @@ jobs:
- name: '⚙ Install ATC Coding Rules updater'
run: dotnet tool install --global atc-coding-rules-updater
- name: ♻️ Run ATC Coding Rules updater
run: atc-coding-rules-updater run --projectPath . --verbose --projectTarget DotNet8 --useTemporarySuppressions
run: atc-coding-rules-updater run --projectPath . --verbose --projectTarget DotNet10 --useTemporarySuppressions
- name: 🐛 Git - show changes
shell: bash
run: |
Expand All @@ -35,7 +35,7 @@ jobs:
- run: |
dotnet build -c Release
- name: 💾Create PR
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v7
with:
commit-message: 'Pipeline ran atc-coding-rules-updater Build: ${{ env.GITHUB_RUN_ID}}'
title: ATC Coding Rules Update
Expand Down
29 changes: 5 additions & 24 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: ubuntu-latest
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.PAT_WORKFLOWS }}
Expand All @@ -30,16 +30,10 @@ jobs:
with:
setAllVars: true

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

- name: ⚙️ Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
dotnet-version: '10.0.x'

- name: 🧹 Clean
run: dotnet clean -c Release && dotnet nuget locals all --clear
Expand All @@ -51,20 +45,7 @@ jobs:
run: dotnet build -c Release --no-restore /p:UseSourceLink=true

- name: 🧪 Run unit tests
run: dotnet test -c Release --no-build --filter "Category!=Integration"

- name: 🌩️ SonarCloud install scanner
run: dotnet tool install --global dotnet-sonarscanner

- name: 🌩️ SonarCloud analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: pwsh
run: |
dotnet sonarscanner begin /k:"atc-coding-rules-updater" /o:"atc-net" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build -c Release /p:UseSourceLink=true --no-restore
dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
run: dotnet test -c Release --no-build --filter-query "/[category!=integration]" --ignore-exit-code 8

- name: ⏩ Merge to stable-branch
run: |
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/pre-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

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

- name: 🧹 Clean
run: dotnet clean -c Release && dotnet nuget locals all --clear
Expand All @@ -39,14 +39,14 @@ jobs:
- dotnet-build
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

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

- name: 🔁 Restore packages
run: dotnet restore
Expand All @@ -55,4 +55,4 @@ jobs:
run: dotnet build -c Release --no-restore /p:UseSourceLink=true

- name: 🧪 Run unit tests
run: dotnet test -c Release --no-build --filter "Category!=Integration"
run: dotnet test -c Release --no-build --filter-query "/[category!=integration]" --ignore-exit-code 8
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.PAT_WORKFLOWS }}
Expand All @@ -27,10 +27,10 @@ jobs:
with:
setAllVars: true

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

- name: 🧹 Clean
run: dotnet clean -c Release && dotnet nuget locals all --clear
Expand Down
72 changes: 0 additions & 72 deletions Atc.CodingRules.Updater.CLI.sln

This file was deleted.

8 changes: 0 additions & 8 deletions Atc.CodingRules.Updater.CLI.sln.DotSettings

This file was deleted.

Loading