From 9ee99d72d3ad417863485c5406a647dc9ef724f7 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Fri, 31 Mar 2023 17:30:30 +0100 Subject: [PATCH] [ci skip] style: upgrade projects to C# 11 NB: While using a higher C# version with lower framework version is possible, it's generally advised against because C# syntax may map to .NET types not available in older versions such as .NET Standard 2.1. This change does not invite the codebase to upgrade to newer types, but rather take advantage of syntax sugar (such as file-scoped namespaces, when this project was updated to C# 10) that does not effect the compiled result. However, this change does open up the possibilities to add extension methods for the "generic math" interfaces (made possible by static interface members), and these upcoming methods will be targeted to .NET 7 or greater **ONLY**. --- CONTRIBUTING.md | 4 ++-- X10D.DSharpPlus/X10D.DSharpPlus.csproj | 2 +- X10D.Hosting/X10D.Hosting.csproj | 2 +- X10D.SourceGenerator/X10D.SourceGenerator.csproj | 2 +- X10D.SourceValidator/X10D.SourceValidator.csproj | 1 + X10D.Tests/X10D.Tests.csproj | 4 ++-- X10D.Unity/X10D.Unity.csproj | 2 +- X10D/X10D.csproj | 4 ++-- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5aa2803..c1d7f77 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ or submit a pull request. ### Pull request guidelines -This project uses C# 10.0 language features where feasible, and adheres to StyleCop rules with some minor adjustments. +This project uses C# 11.0 language features where feasible, and adheres to StyleCop rules with some minor adjustments. There is an `.editorconfig` included in this repository. For quick and painless pull requests, ensure that the analyzer does not throw warnings. @@ -13,7 +13,7 @@ throw warnings. Below are a few pointers to which you may refer, but keep in mind this is not an exhaustive list: -- Use C# 10.0 features where possible +- Use C# 11.0 features where possible - Try to ensure code is CLS-compliant. Where this is not possible, decorate methods with `CLSCompliantAttribute` and pass `false` - Follow all .NET guidelines and coding conventions. See https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions diff --git a/X10D.DSharpPlus/X10D.DSharpPlus.csproj b/X10D.DSharpPlus/X10D.DSharpPlus.csproj index aff44a4..2e8bf54 100644 --- a/X10D.DSharpPlus/X10D.DSharpPlus.csproj +++ b/X10D.DSharpPlus/X10D.DSharpPlus.csproj @@ -2,7 +2,7 @@ net7.0;net6.0;netstandard2.1 - 10.0 + 11.0 true true Oliver Booth diff --git a/X10D.Hosting/X10D.Hosting.csproj b/X10D.Hosting/X10D.Hosting.csproj index 23b5f4b..14bce23 100644 --- a/X10D.Hosting/X10D.Hosting.csproj +++ b/X10D.Hosting/X10D.Hosting.csproj @@ -2,7 +2,7 @@ net7.0;net6.0;netstandard2.1 - 10.0 + 11.0 true true Oliver Booth diff --git a/X10D.SourceGenerator/X10D.SourceGenerator.csproj b/X10D.SourceGenerator/X10D.SourceGenerator.csproj index 8220df9..800d5fc 100644 --- a/X10D.SourceGenerator/X10D.SourceGenerator.csproj +++ b/X10D.SourceGenerator/X10D.SourceGenerator.csproj @@ -2,7 +2,7 @@ netstandard2.0 - 10.0 + 11.0 enable enable diff --git a/X10D.SourceValidator/X10D.SourceValidator.csproj b/X10D.SourceValidator/X10D.SourceValidator.csproj index f399bb9..213a980 100644 --- a/X10D.SourceValidator/X10D.SourceValidator.csproj +++ b/X10D.SourceValidator/X10D.SourceValidator.csproj @@ -3,6 +3,7 @@ Exe net7.0 + 11.0 enable enable diff --git a/X10D.Tests/X10D.Tests.csproj b/X10D.Tests/X10D.Tests.csproj index 69ae0a2..e547f07 100644 --- a/X10D.Tests/X10D.Tests.csproj +++ b/X10D.Tests/X10D.Tests.csproj @@ -1,8 +1,8 @@ - net7.0;net6.0 - 10.0 + net7.0 + 11.0 false enable true diff --git a/X10D.Unity/X10D.Unity.csproj b/X10D.Unity/X10D.Unity.csproj index a6d564d..9e3c9cd 100644 --- a/X10D.Unity/X10D.Unity.csproj +++ b/X10D.Unity/X10D.Unity.csproj @@ -2,7 +2,7 @@ netstandard2.1 - 10.0 + 11.0 true true Oliver Booth diff --git a/X10D/X10D.csproj b/X10D/X10D.csproj index 00dc6b0..bb29668 100644 --- a/X10D/X10D.csproj +++ b/X10D/X10D.csproj @@ -2,7 +2,7 @@ net7.0;net6.0;netstandard2.1 - 10.0 + 11.0 true true Oliver Booth @@ -87,4 +87,4 @@ - \ No newline at end of file +