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
209 changes: 209 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
root = true # Do NOT inherit any higher level settings.

[*.cs]
# IDE0005: Remove unnecessary using directives (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0005)
dotnet_diagnostic.IDE0005.severity = suggestion
# IDE0017: Object initialization can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0017)
dotnet_diagnostic.IDE0017.severity = suggestion
# IDE0022: Use expression body for methods (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0022)
dotnet_diagnostic.IDE0022.severity = silent
# IDE0028: Simplify collection initialization
dotnet_diagnostic.IDE0028.severity = silent
# IDE0037: Use inferred member name
dotnet_diagnostic.IDE0037.severity = none
# IDE0045: 'if' statement can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0045)
dotnet_diagnostic.IDE0045.severity = silent
# IDE0046: Use conditional expression for return (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0046)
dotnet_diagnostic.IDE0046.severity = none
# IDE0055: Formatting rule (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0055)
dotnet_diagnostic.IDE0055.severity = none
# IDE0057: Substring can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0057)
dotnet_diagnostic.IDE0057.severity = suggestion
# IDE0058: Expression value is never used (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0058)
dotnet_diagnostic.IDE0058.severity = none
# IDE0063: Use simple 'using' statement (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0063)
csharp_prefer_simple_using_statement = false
dotnet_diagnostic.IDE0063.severity = none
# IDE0078: Use pattern matching (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0078)
dotnet_diagnostic.IDE0078.severity = warning
# IDE0090: Use 'new(...)'
dotnet_diagnostic.IDE0090.severity = silent
# IDE0220: Add explicit cast (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0220)
dotnet_diagnostic.IDE0220.severity = warning
# IDE0220: Add explicit cast (https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0220#dotnet_style_prefer_foreach_explicit_cast_in_source)
dotnet_style_prefer_foreach_explicit_cast_in_source = always
# IDE0270: Null check can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0270)
dotnet_diagnostic.IDE0270.severity = suggestion
# IDE0280: Use 'nameof'
dotnet_diagnostic.IDE0280.severity = warning
# IDE0290: Use primary constructor - It's a case by case choice.
dotnet_diagnostic.IDE0290.severity = silent
# IDE0305: Collection initialization can be simplified (https://github.com/dotnet/roslyn/issues/70656)
dotnet_diagnostic.IDE0305.severity = silent # Some suggestions are bad.
# IDE1006: Naming rule violation - Sadly, the 'Naming styles' are not sufficient enough, use ReSharper!
dotnet_diagnostic.IDE1006.severity = none

# CA1024: Use properties where appropriate
dotnet_diagnostic.CA1024.severity = none
# CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = silent
# CA1304: Specify CultureInfo
dotnet_diagnostic.CA1304.severity = none
# CA1305: Specify IFormatProvider
dotnet_diagnostic.CA1305.severity = none
# CA1309: Use ordinal string comparison
dotnet_diagnostic.CA1309.severity = none
# CA1507: Use nameof to express symbol names
dotnet_diagnostic.CA1507.severity = suggestion
# CA1716: Identifiers should not match keywords
dotnet_diagnostic.CA1716.severity = none
# CA1720: Identifier contains type name
dotnet_diagnostic.CA1720.severity = none
# CA1725: Parameter names should match base declaration
dotnet_diagnostic.CA1725.severity = silent
# CA1806: Do not ignore method results
dotnet_diagnostic.CA1806.severity = silent
# CA1815: Override equals and operator equals on value types
dotnet_diagnostic.CA1815.severity = silent
# CA1819: Properties should not return arrays
dotnet_diagnostic.CA1819.severity = none
# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = silent
# CA1847: Use char literal for a single character lookup
dotnet_diagnostic.CA1847.severity = warning
# CA1848: Use the LoggerMessage delegates
dotnet_diagnostic.CA1848.severity = silent
# CA1863: Use 'CompositeFormat' - The default is warning and in some cases it's not true
dotnet_diagnostic.CA1863.severity = suggestion
# CA2007: Consider calling ConfigureAwait on the awaited task
dotnet_diagnostic.CA2007.severity = none
# CA2016: Forward the 'CancellationToken' parameter to methods
dotnet_diagnostic.CA2016.severity = suggestion # R# is better at this, pointing to the corect method, instead of the whole call.
# CA2201: Do not raise reserved exception types
dotnet_diagnostic.CA2201.severity = error
# CA2234: Pass system uri objects instead of strings
dotnet_diagnostic.CA2234.severity = none

# CS1591: Missing XML comment for publicly visible type or member (https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs1591)
dotnet_diagnostic.CS1591.severity = none
# CS8602: Dereference of a possibly null reference (https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/nullable-warnings#possible-dereference-of-null)
dotnet_diagnostic.CS8602.severity = error

# MSTEST0016: Test class should have test method (https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0016)
dotnet_diagnostic.MSTEST0016.severity = warning
# MSTEST0039: Use newer methods to assert exceptions (https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0039)
dotnet_diagnostic.MSTEST0039.severity = warning
# MSTEST0042: Avoid duplicated 'DataRow' entries (https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0042)
dotnet_diagnostic.MSTEST0042.severity = warning
# MSTEST0049: Flow TestContext.CancellationToken to async operations (https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0049)
dotnet_diagnostic.MSTEST0049.severity = warning

[*.{cs,vb}]
csharp_style_expression_bodied_methods = when_on_single_line
csharp_style_expression_bodied_accessors = when_on_single_line # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0027
csharp_style_expression_bodied_operators = when_on_single_line # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0023
csharp_style_namespace_declarations = file_scoped

dotnet_sort_system_directives_first = false

dotnet_style_qualification_for_field = true:silent
dotnet_style_qualification_for_property = true:silent
dotnet_style_qualification_for_method = true:silent
dotnet_style_qualification_for_event = true:silent

# ■■■ Naming styles ■■■

# ■■ Non-functional Rules (matching only happens on the 'symbols' (Specification), not the 'style' (Suffix)).

# ■ Dependency Property backend field - public static readonly DependencyProperty MyProperty = DependencyProperty.Register(...)
dotnet_naming_rule.PublicStaticReadonlyField.severity = warning
dotnet_naming_rule.PublicStaticReadonlyField.symbols = public_static_readonly_fields
dotnet_naming_rule.PublicStaticReadonlyField.style = PascalCaseProperty
# ■ Public static readonly field (Default) - public static readonly TypeOfField MyFieldName = ...
dotnet_naming_rule.PublicStaticReadonlyField.severity = warning
dotnet_naming_rule.PublicStaticReadonlyField.symbols = public_static_readonly_fields
dotnet_naming_rule.PublicStaticReadonlyField.style = PascalCase

# ■ Dependency Property backend field - private static readonly DependencyPropertyKey MyPropertyKey = DependencyProperty.RegisterReadOnly(...)
dotnet_naming_rule.PrivateStaticReadonlyField.severity = warning # Should be warning
dotnet_naming_rule.PrivateStaticReadonlyField.symbols = private_static_readonly_fields
dotnet_naming_rule.PrivateStaticReadonlyField.style = PascalCasePropertyKey
# ■ Private static readonly field (Default) - private static readonly TypeOfField myFieldName = ...
dotnet_naming_rule.PrivateStaticReadonlyField.severity = information # Should be warning
dotnet_naming_rule.PrivateStaticReadonlyField.symbols = private_static_readonly_fields
dotnet_naming_rule.PrivateStaticReadonlyField.style = CamelCase

# ■■ End of Non-functional Rules

dotnet_naming_rule.InstanceField.severity = suggestion
dotnet_naming_rule.InstanceField.symbols = all_fields
dotnet_naming_rule.InstanceField.style = CamelCase

dotnet_naming_rule.ConstantField.severity = suggestion
dotnet_naming_rule.ConstantField.symbols = const_fields
dotnet_naming_rule.ConstantField.style = PascalCase

dotnet_naming_rule.NonPrivateField.severity = suggestion
dotnet_naming_rule.NonPrivateField.symbols = non_private_fields
dotnet_naming_rule.NonPrivateField.style = PascalCase

# ■■■ Symbol specifications ■■■

dotnet_naming_symbols.all_fields.applicable_kinds = field

dotnet_naming_symbols.const_fields.applicable_kinds = field
dotnet_naming_symbols.const_fields.required_modifiers = const

dotnet_naming_symbols.public_fields.applicable_kinds = field
dotnet_naming_symbols.public_fields.applicable_accessibilities = public

dotnet_naming_symbols.non_private_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_fields.applicable_accessibilities = public, internal, protected, protected_internal

dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readonly, static

dotnet_naming_symbols.public_static_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.public_static_readonly_fields.applicable_accessibilities = public
dotnet_naming_symbols.public_static_readonly_fields.required_modifiers = readonly, static

# ■■■ Naming styles ■■■

dotnet_naming_style.PascalCase.required_prefix =
dotnet_naming_style.PascalCase.required_suffix =
dotnet_naming_style.PascalCase.word_separator =
dotnet_naming_style.PascalCase.capitalization = pascal_case

dotnet_naming_style.CamelCase.required_prefix =
dotnet_naming_style.CamelCase.required_suffix =
dotnet_naming_style.CamelCase.word_separator =
dotnet_naming_style.CamelCase.capitalization = camel_case

dotnet_naming_style.IPascalCase.required_prefix = I
dotnet_naming_style.IPascalCase.required_suffix =
dotnet_naming_style.IPascalCase.word_separator =
dotnet_naming_style.IPascalCase.capitalization = pascal_case

dotnet_naming_style.PascalCaseProperty.required_suffix = Property
dotnet_naming_style.PascalCaseProperty.capitalization = pascal_case

dotnet_naming_style.PascalCasePropertyKey.required_suffix = PropertyKey
dotnet_naming_style.PascalCasePropertyKey.capitalization = pascal_case

# ■■■ RESX Formatter ■■■

[*.resx]
resx_formatter_sort_entries = true
resx_formatter_remove_xsd_schema = false
resx_formatter_remove_documentation_comment = true
resx_formatter_sort_comparer = OrdinalIgnoreCase

# ■■■ MAUI Rules ■■■

[*.cs]
# CsWinRT1028: Class should be marked partial
dotnet_diagnostic.CsWinRT1028.severity = warning

# MVVMTK0034: Direct field reference to [ObservableProperty] backing field
dotnet_diagnostic.MVVMTK0034.severity = error
39 changes: 39 additions & 0 deletions .github/workflows/Launchbar-CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build Launchbar

on:
push:
branches:
- '*'
tags:
- '*'
pull_request:
branches:
- '*'

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v6 # https://github.com/marketplace/actions/checkout

- name: Setup .NET
uses: actions/setup-dotnet@v5 # https://github.com/marketplace/actions/setup-net-core-sdk
with:
global-json-file: Source/global.json

- name: Build
run: dotnet build Source/Launchbar.slnx --configuration Release

- name: Test
run: dotnet test Source/Launchbar.slnx --configuration Release

- name: Publish
run: dotnet publish Source/Launchbar.slnx --configuration Release

- name: Upload
uses: actions/upload-artifact@v4 # https://github.com/marketplace/actions/upload-a-build-artifact
with:
name: Launchbar
path: Source/artifacts/publish/Launchbar/release/**
if-no-files-found: error
34 changes: 0 additions & 34 deletions .github/workflows/dotnet.yml

This file was deleted.

Loading