Skip to content
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

.NET ⑨ (strongest version) #3244

Merged
merged 22 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -75,30 +75,30 @@
csharp_style_expression_bodied_operators = true:warning
csharp_style_expression_bodied_properties = true:warning

csharp_style_implicit_object_creation_when_type_is_apparent = true:warning

Check warning on line 78 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
csharp_style_inlined_variable_declaration = true:warning

csharp_style_namespace_declarations = file_scoped:warning

Check warning on line 81 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported

csharp_style_pattern_matching_over_as_with_null_check = true:warning
csharp_style_pattern_matching_over_is_with_cast_check = true:warning

csharp_style_prefer_extended_property_pattern = true:warning

Check warning on line 86 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
dotnet_style_prefer_foreach_explicit_cast_in_source = always:warning

Check warning on line 87 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
csharp_style_prefer_index_operator = true:warning
csharp_style_prefer_local_over_anonymous_function = true:warning

Check warning on line 89 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
csharp_style_prefer_method_group_conversion = true:warning

Check warning on line 90 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
csharp_style_prefer_not_pattern = true:warning
csharp_style_prefer_null_check_over_type_check = true:warning

Check warning on line 92 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
csharp_style_prefer_pattern_matching = true:warning
csharp_style_prefer_primary_constructors = true:warning

Check warning on line 94 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
csharp_style_prefer_range_operator = true:warning
csharp_style_prefer_readonly_struct = true:warning

Check warning on line 96 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
csharp_style_prefer_readonly_struct_member = true:warning

Check warning on line 97 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
csharp_style_prefer_switch_expression = true:warning
csharp_style_prefer_top_level_statements = false:warning

Check warning on line 99 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
csharp_style_prefer_tuple_swap = true:warning

Check warning on line 100 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
csharp_style_prefer_utf8_string_literals = true:warning

Check warning on line 101 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported

csharp_style_throw_expression = true:warning

Expand All @@ -115,16 +115,17 @@
# .NET Coding Conventions #
###############################

dotnet_analyzer_diagnostic.severity = warning

Check warning on line 118 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported

dotnet_code_quality.ca3003.excluded_symbol_names = BotController

Check warning on line 120 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
dotnet_code_quality.ca3012.excluded_symbol_names = BotController|CommandController

Check warning on line 121 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported

dotnet_code_quality_unused_parameters = all:warning

# Ignored code inspections that we do not agree with
dotnet_diagnostic.ca1028.severity = silent

Check warning on line 126 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
dotnet_diagnostic.ca1031.severity = silent

Check warning on line 127 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
dotnet_diagnostic.ca1863.severity = silent

Check warning on line 128 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported

# Rule - almost everything
dotnet_naming_rule.almost_everything_must_be_pascal_case.severity = warning
Expand Down Expand Up @@ -189,14 +190,14 @@
dotnet_naming_symbols.type_parameters.applicable_accessibilities = *
dotnet_naming_symbols.type_parameters.applicable_kinds = type_parameter

dotnet_remove_unnecessary_suppression_exclusions = none:warning

Check warning on line 193 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = true

dotnet_style_coalesce_expression = true:warning
dotnet_style_collection_initializer = true:warning
dotnet_style_explicit_tuple_names = true:warning
dotnet_style_namespace_match_folder = true:warning

Check warning on line 200 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
dotnet_style_null_propagation = true:warning
dotnet_style_object_initializer = true:warning

Expand Down Expand Up @@ -226,6 +227,10 @@
dotnet_style_readonly_field = true:warning
dotnet_style_require_accessibility_modifiers = always:warning

[ArchiSteamFarm/**.cs]
# ASF project includes plugin system, therefore CA1515 typically doesn't make sense there
dotnet_diagnostic.ca1515.severity = silent

Check warning on line 232 in .editorconfig

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Unknown property

The property is not supported
Fixed Show fixed Hide fixed

###############################
# JetBrains, IntelliJ/Rider #
###############################
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
DOTNET_SDK_VERSION: 8.0
DOTNET_SDK_VERSION: 9.0

permissions: {}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
CONFIGURATION: Release
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
DOTNET_SDK_VERSION: 8.0
DOTNET_SDK_VERSION: 9.0
NODE_JS_VERSION: 'lts/*'
PLUGINS_BUNDLED: ArchiSteamFarm.OfficialPlugins.ItemsMatcher ArchiSteamFarm.OfficialPlugins.MobileAuthenticator ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
PLUGINS_INCLUDED: ArchiSteamFarm.OfficialPlugins.Monitoring # Apart from declaring them here, there is certain amount of hardcoding needed below for uploading
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
if [ "$VARIANT" = 'generic' ]; then
variantArgs="-p:TargetLatestRuntimePatch=false -p:UseAppHost=false"
else
variantArgs="-p:PublishSingleFile=true -p:PublishTrimmed=true -r $VARIANT --self-contained"
variantArgs="-p:PublishSingleFile=true -r $VARIANT --self-contained"
fi

dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -o "out/${VARIANT}" "-p:ASFVariant=${VARIANT}" -p:ContinuousIntegrationBuild=true --nologo $variantArgs
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
if ($env:VARIANT -like 'generic*') {
$variantArgs = '-p:TargetLatestRuntimePatch=false', '-p:UseAppHost=false'
} else {
$variantArgs = '-p:PublishSingleFile=true', '-p:PublishTrimmed=true', '-r', "$env:VARIANT", '--self-contained'
$variantArgs = '-p:PublishSingleFile=true', '-r', "$env:VARIANT", '--self-contained'
}

dotnet publish ArchiSteamFarm -c "$env:CONFIGURATION" -o "out\$env:VARIANT" "-p:ASFVariant=$env:VARIANT" -p:ContinuousIntegrationBuild=true --nologo $variantArgs
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<RepositoryUrl>$(PackageProjectUrl).git</RepositoryUrl>
<RollForward>LatestMajor</RollForward>
<RuntimeIdentifiers>linux-arm;linux-arm64;linux-x64;osx-arm64;osx-x64;win-arm64;win-x64</RuntimeIdentifiers>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup>

Expand All @@ -50,7 +50,7 @@
<DebugType>none</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<WarningsNotAsErrors>CA1863,CS8002,IL2026,IL2104,NU1901,NU1902,NU1903,NU1904</WarningsNotAsErrors>
<WarningsNotAsErrors>CS8002,IL2026,IL2104,NU1901,NU1902,NU1903,NU1904</WarningsNotAsErrors>
</PropertyGroup>

<!-- Enable public signing if not part of Visual Studio, which is too stupid to understand what public signing is -->
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN <<EOF
npm run deploy --no-progress
EOF

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0${IMAGESUFFIX} AS build-dotnet
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-preview${IMAGESUFFIX} AS build-dotnet
ARG CONFIGURATION=Release
ARG TARGETARCH
ARG TARGETOS
Expand Down Expand Up @@ -76,7 +76,7 @@ RUN --mount=type=secret,id=ASF_PRIVATE_SNK --mount=type=secret,id=STEAM_TOKEN_DU
done
EOF

FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0${IMAGESUFFIX} AS runtime
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:9.0-preview${IMAGESUFFIX} AS runtime
ENV ASF_PATH=/app
ENV ASF_USER=asf
ENV ASPNETCORE_URLS=
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.Service
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN <<EOF
npm run deploy --no-progress
EOF

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0${IMAGESUFFIX} AS build-dotnet
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-preview${IMAGESUFFIX} AS build-dotnet
ARG CONFIGURATION=Release
ARG TARGETARCH
ARG TARGETOS
Expand Down Expand Up @@ -57,7 +57,7 @@ RUN --mount=type=secret,id=ASF_PRIVATE_SNK --mount=type=secret,id=STEAM_TOKEN_DU
echo "WARN: No ASF_PRIVATE_SNK provided!"
fi

dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -o "out" "-p:ASFVariant=${asf_variant}" -p:ContinuousIntegrationBuild=true -p:PublishSingleFile=true -p:PublishTrimmed=true -r "$asf_variant" --nologo --self-contained
dotnet publish ArchiSteamFarm -c "$CONFIGURATION" -o "out" "-p:ASFVariant=${asf_variant}" -p:ContinuousIntegrationBuild=true -p:PublishSingleFile=true -r "$asf_variant" --nologo --self-contained

if [ -f "/run/secrets/STEAM_TOKEN_DUMPER_TOKEN" ]; then
STEAM_TOKEN_DUMPER_TOKEN="$(cat "/run/secrets/STEAM_TOKEN_DUMPER_TOKEN")"
Expand All @@ -76,7 +76,7 @@ RUN --mount=type=secret,id=ASF_PRIVATE_SNK --mount=type=secret,id=STEAM_TOKEN_DU
done
EOF

FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime-deps:8.0${IMAGESUFFIX} AS runtime
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime-deps:9.0-preview${IMAGESUFFIX} AS runtime
ENV ASF_PATH=/app
ENV ASF_USER=asf
ENV ASPNETCORE_URLS=
Expand Down