Skip to content

Commit

Permalink
Migration from ExceptionsAPI Project (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenswan committed Sep 29, 2023
1 parent 27dd5eb commit 04336a6
Show file tree
Hide file tree
Showing 63 changed files with 3,868 additions and 1 deletion.
255 changes: 255 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
###############################
# Core EditorConfig Options #
###############################
root = true
# All files
[*]
indent_style = space
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# XML config files
[*.{xml,config,*proj,nuspec,props,targets,ruleset,resx,vsixmanifest,vsct,yml,tasks}]
indent_size = 2

# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = true
charset = utf-8-bom

[*.json]
indent_size = 2

[*.{ps1,psm1}]
indent_size = 4

[*.sh]
indent_size = 4
end_of_line = lf

[*.{razor,cshtml}]
charset = utf-8-bom

[*.cs]

# Directive sorting
dotnet_sort_system_directives_first = false

# Expression Bodied Members (method() => body)
csharp_style_expression_bodied_methods = true:warning

# Require var when apparent
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion

# Namespace settings
csharp_style_namespace_declarations = file_scoped

# var preferences
csharp_style_var_elsewhere = false:warning
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_when_type_is_apparent = true:warning

# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true

# IDE0073: File header
dotnet_diagnostic.IDE0073.severity = warning
file_header_template = -------------------------------------------------------\nCopyright (c) BlazorFocused All rights reserved.\nLicensed under the MIT License\n-------------------------------------------------------

# CA1047: Do not declare protected member in sealed type
dotnet_diagnostic.CA1047.severity = warning

# CA1507: Use nameof to express symbol names
dotnet_diagnostic.CA1507.severity = warning

# CA1725: Parameter names should match base declaration
dotnet_diagnostic.CA1725.severity = warning

# CA1802: Use literals where appropriate
dotnet_diagnostic.CA1802.severity = warning

# CA1805: Do not initialize unnecessarily
dotnet_diagnostic.CA1805.severity = warning

# CA1810: Do not initialize unnecessarily
dotnet_diagnostic.CA1810.severity = warning

# CA1821: Remove empty Finalizers
dotnet_diagnostic.CA1821.severity = warning

# CA1822: Make member static
dotnet_diagnostic.CA1822.severity = warning
dotnet_code_quality.CA1822.api_surface = private, internal

# CA1823: Avoid unused private fields
dotnet_diagnostic.CA1823.severity = warning

# CA1825: Avoid zero-length array allocations
dotnet_diagnostic.CA1825.severity = warning

# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly
dotnet_diagnostic.CA1826.severity = warning

# CA1827: Do not use Count() or LongCount() when Any() can be used
dotnet_diagnostic.CA1827.severity = warning

# CA1828: Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used
dotnet_diagnostic.CA1828.severity = warning

# CA1829: Use Length/Count property instead of Count() when available
dotnet_diagnostic.CA1829.severity = warning

# CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder
dotnet_diagnostic.CA1830.severity = warning

# CA1834: Consider using 'StringBuilder.Append(char)' when applicable
dotnet_diagnostic.CA1834.severity = warning

# CA1836: Prefer IsEmpty over Count
dotnet_diagnostic.CA1836.severity = warning

# CA1841: Prefer Dictionary.Contains methods
dotnet_diagnostic.CA1841.severity = warning

# CA1842: Do not use 'WhenAll' with a single task
dotnet_diagnostic.CA1842.severity = warning

# CA1843: Do not use 'WaitAll' with a single task
dotnet_diagnostic.CA1843.severity = warning

# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'
dotnet_diagnostic.CA1844.severity = warning

# CA1845: Use span-based 'string.Concat'
dotnet_diagnostic.CA1845.severity = warning

# CA1846: Prefer AsSpan over Substring
dotnet_diagnostic.CA1846.severity = warning

# CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
dotnet_diagnostic.CA1847.severity = warning

# CA1854: Prefer a 'TryGetValue' call over Dictionary indexer access guarded by a 'ContainsKey' check to avoid double lookup
dotnet_diagnostic.CA1847.severity = warning

# CA2009: Do not call ToImmutableCollection on an ImmutableCollection value
dotnet_diagnostic.CA2009.severity = warning

# CA2011: Avoid infinite recursion
dotnet_diagnostic.CA2011.severity = warning

# CA2012: Use ValueTask correctly
dotnet_diagnostic.CA2012.severity = warning

# CA2016: Forward the 'CancellationToken' parameter to methods that take one
dotnet_diagnostic.CA2016.severity = warning

# CA2200: Rethrow to preserve stack details
dotnet_diagnostic.CA2200.severity = warning

# CA2208: Instantiate argument exceptions correctly
dotnet_diagnostic.CA2208.severity = warning

# CA2245: Do not assign a property to itself
dotnet_diagnostic.CA2245.severity = warning

# CA2246: Assigning symbol and its member in the same statement
dotnet_diagnostic.CA2246.severity = warning

# CA2249: Use string.Contains instead of string.IndexOf to improve readability.
dotnet_diagnostic.CA2249.severity = warning

# IDE0005: Remove unnecessary usings
dotnet_diagnostic.IDE0005.severity = warning

# IDE0011: Curly braces to surround blocks of code
dotnet_diagnostic.IDE0011.severity = warning

# IDE0020: Use pattern matching to avoid is check followed by a cast (with variable)
dotnet_diagnostic.IDE0020.severity = warning

# IDE0022: Use expression body for methods (method() => body)
dotnet_diagnostic.IDE0022.severity = warning

# IDE0029: Use coalesce expression (non-nullable types)
dotnet_diagnostic.IDE0029.severity = warning

# IDE0030: Use coalesce expression (nullable types)
dotnet_diagnostic.IDE0030.severity = warning

# IDE0031: Use null propagation
dotnet_diagnostic.IDE0031.severity = warning

# IDE0035: Remove unreachable code
dotnet_diagnostic.IDE0035.severity = warning

# IDE0036: Order modifiers
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
dotnet_diagnostic.IDE0036.severity = warning

# IDE0038: Use pattern matching to avoid is check followed by a cast (without variable)
dotnet_diagnostic.IDE0038.severity = warning

# IDE0039: Use local function
dotnet_diagnostic.IDE0039.severity = warning

# IDE0043: Format string contains invalid placeholder
dotnet_diagnostic.IDE0043.severity = warning

# IDE0044: Make field readonly
dotnet_diagnostic.IDE0044.severity = warning

# IDE0051: Remove unused private members
dotnet_diagnostic.IDE0051.severity = warning

# IDE0052: Remove unread private members
dotnet_diagnostic.IDE0052.severity = warning

# IDE0055: All formatting rules
dotnet_diagnostic.IDE0055.severity = suggestion

# IDE0059: Unnecessary assignment to a value
dotnet_diagnostic.IDE0059.severity = warning

# IDE0060: Remove unused parameter
dotnet_code_quality_unused_parameters = non_public
dotnet_diagnostic.IDE0060.severity = warning

# IDE0062: Make local function static
dotnet_diagnostic.IDE0062.severity = warning

# IDE0063: Use simple using statement
dotnet_diagnostic.IDE0063.severity = warning

# IDE0074: Use coalesce compound expression
dotnet_diagnostic.IDE0074.severity = warning

# IDE0075: Simplify conditional expression
dotnet_diagnostic.IDE0075.severity = warning

# IDE0078: Use pattern matching
dotnet_diagnostic.IDE0078.severity = warning

# IDE0090: Simplify new expression
dotnet_diagnostic.IDE0090.severity = warning

# IDE0161: Convert to file-scoped namespace
dotnet_diagnostic.IDE0161.severity = warning

# IDE0200: Lambda expression can be removed
dotnet_diagnostic.IDE0200.severity = warning

# IDE2000: Disallow multiple blank lines
dotnet_style_allow_multiple_blank_lines_experimental = false
dotnet_diagnostic.IDE2000.severity = warning
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths.
# More details are here: https://help.github.com/articles/about-codeowners/

# The '*' pattern is global owners.

# Global rule:
* @kenswan
46 changes: 46 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Continuous Integration

on:
push:
branches:
- main
paths-ignore:
- "docs/**"
- "**/README.md"
pull_request:
branches:
- main
paths-ignore:
- "docs/**"
- "**/README.md"
release:
types:
- published

jobs:
build-middleware:
uses: ./.github/workflows/template-build-test-project.yml
with:
name: "BlazorFocused.Exceptions.Middleware Build"
source-directory: ./src/Middleware/src
source-project: BlazorFocused.Exceptions.Middleware.csproj
test-directory: ./src/Middleware/test
test-project: BlazorFocused.Exceptions.Middleware.Test.csproj

build-samples:
uses: ./.github/workflows/template-build-test-solution.yml
with:
name: "BlazorFocused.Exceptions.Samples Build"
working-directory: ./samples

release-middleware:
needs: [build-middleware, build-samples]
if: github.event_name == 'release'
uses: ./.github/workflows/template-release-nuget-package.yml
with:
name: "Template.Starter Release"
source-project-path: ./Middleware/src/BlazorFocused.Exceptions.Middleware.csproj
source-release-path: ./Middleware/src/bin/Release
working-directory: ./src
version: ${{ github.event.release.tag_name }}
secrets: inherit
25 changes: 25 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Documentation

on:
push:
branches:
- main
paths:
- "docs/**"
pull_request:
branches:
- main
paths:
- "docs/**"

jobs:
docs:
permissions:
contents: write
uses: ./.github/workflows/template-release-docs.yml
with:
name: "BlazorFocused.Exceptions Documentation"
documentation-folder-path: docs
github-pages-branch: gh-pages
github-user-email: blazorfocused-automation@users.noreply.github.com
github-user-name: Pages-Automation

0 comments on commit 04336a6

Please sign in to comment.