From 1e27807059fe81e48e81603bf393503611d74cf8 Mon Sep 17 00:00:00 2001 From: Lala Sabathil Date: Wed, 23 Nov 2022 19:12:16 +0100 Subject: [PATCH] bump stuff --- .../DisCatSharp.ApplicationCommands.csproj | 2 +- .../DisCatSharp.CommandsNext.csproj | 2 +- DisCatSharp.Common/DisCatSharp.Common.csproj | 2 +- .../DisCatSharp.Configuration.Tests.csproj | 2 +- .../DisCatSharp.Configuration.csproj | 2 +- DisCatSharp.Docs/vs/toc.yml | 6 ++++ .../DisCatSharp.Experimental.csproj | 2 +- DisCatSharp.Experimental/Program.cs | 36 ------------------- ...atSharp.Hosting.DependencyInjection.csproj | 2 +- .../DisCatSharp.Hosting.Tests.csproj | 2 +- .../DisCatSharp.Hosting.csproj | 2 +- .../DisCatSharp.Interactivity.csproj | 2 +- .../DisCatSharp.Lavalink.csproj | 2 +- .../DisCatSharp.Analyzer.Package.csproj | 4 +-- .../AnalyzerReleases.Shipped.md | 11 ++++++ .../DisCatSharp.Analyzer/AttributeAnalyzer.cs | 20 +++++------ .../DisCatSharp.VoiceNext.Natives.csproj | 4 +++ .../DisCatSharp.VoiceNext.csproj | 2 +- DisCatSharp/DisCatSharp.csproj | 2 +- .../Entities/Guild/DiscordGuild.Features.cs | 24 ------------- 20 files changed, 45 insertions(+), 86 deletions(-) delete mode 100644 DisCatSharp.Experimental/Program.cs diff --git a/DisCatSharp.ApplicationCommands/DisCatSharp.ApplicationCommands.csproj b/DisCatSharp.ApplicationCommands/DisCatSharp.ApplicationCommands.csproj index 100029252d..e4525fdadd 100644 --- a/DisCatSharp.ApplicationCommands/DisCatSharp.ApplicationCommands.csproj +++ b/DisCatSharp.ApplicationCommands/DisCatSharp.ApplicationCommands.csproj @@ -25,7 +25,7 @@ Documentation: https://docs.discatsharp.tech/articles/modules/application_comman - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp.CommandsNext/DisCatSharp.CommandsNext.csproj b/DisCatSharp.CommandsNext/DisCatSharp.CommandsNext.csproj index cd10d45916..2d59259064 100644 --- a/DisCatSharp.CommandsNext/DisCatSharp.CommandsNext.csproj +++ b/DisCatSharp.CommandsNext/DisCatSharp.CommandsNext.csproj @@ -31,7 +31,7 @@ Documentation: https://docs.discatsharp.tech/articles/modules/commandsnext/intro - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp.Common/DisCatSharp.Common.csproj b/DisCatSharp.Common/DisCatSharp.Common.csproj index 8e05a81571..9be17bc2cb 100644 --- a/DisCatSharp.Common/DisCatSharp.Common.csproj +++ b/DisCatSharp.Common/DisCatSharp.Common.csproj @@ -31,7 +31,7 @@ Common tools for DisCatSharp, like regexes and converters! - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp.Configuration.Tests/DisCatSharp.Configuration.Tests.csproj b/DisCatSharp.Configuration.Tests/DisCatSharp.Configuration.Tests.csproj index 452cfaf739..61e76592e8 100644 --- a/DisCatSharp.Configuration.Tests/DisCatSharp.Configuration.Tests.csproj +++ b/DisCatSharp.Configuration.Tests/DisCatSharp.Configuration.Tests.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp.Configuration/DisCatSharp.Configuration.csproj b/DisCatSharp.Configuration/DisCatSharp.Configuration.csproj index d1fe0f8979..1161da9f1f 100644 --- a/DisCatSharp.Configuration/DisCatSharp.Configuration.csproj +++ b/DisCatSharp.Configuration/DisCatSharp.Configuration.csproj @@ -21,7 +21,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp.Docs/vs/toc.yml b/DisCatSharp.Docs/vs/toc.yml index a5021d0112..8389d78eef 100644 --- a/DisCatSharp.Docs/vs/toc.yml +++ b/DisCatSharp.Docs/vs/toc.yml @@ -6,3 +6,9 @@ items: - name: DCS0001 href: analyzer/dcs/0001.md + - name: DCS0101 + href: analyzer/dcs/0101.md + - name: DCS0102 + href: analyzer/dcs/0102.md + - name: DCS0103 + href: analyzer/dcs/0103.md diff --git a/DisCatSharp.Experimental/DisCatSharp.Experimental.csproj b/DisCatSharp.Experimental/DisCatSharp.Experimental.csproj index 76637f3214..e571e22c24 100644 --- a/DisCatSharp.Experimental/DisCatSharp.Experimental.csproj +++ b/DisCatSharp.Experimental/DisCatSharp.Experimental.csproj @@ -23,7 +23,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp.Experimental/Program.cs b/DisCatSharp.Experimental/Program.cs deleted file mode 100644 index a0114c8715..0000000000 --- a/DisCatSharp.Experimental/Program.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; - -using DisCatSharp.Attributes; - -namespace DisCatSharp.Experimental; - -internal class Program -{ - internal static void Main(string[] args = null) - { - var test = new Test("test"); - test.Invoke(); - var str = test.TestString; - } -} - -[Experimental("class")] -internal class Test -{ - [Experimental("property")] - internal string TestString { get; set; } - - [Experimental("construct")] - internal Test([Experimental("test arg")] string test = null) - { - this.TestString = test; - } - - [Experimental("construct 2")] - internal Test() - { } - - [Experimental("method")] - internal void Invoke() - => Console.WriteLine(this.TestString); -} diff --git a/DisCatSharp.Hosting.DependencyInjection/DisCatSharp.Hosting.DependencyInjection.csproj b/DisCatSharp.Hosting.DependencyInjection/DisCatSharp.Hosting.DependencyInjection.csproj index d8cac4f511..d534bc1f69 100644 --- a/DisCatSharp.Hosting.DependencyInjection/DisCatSharp.Hosting.DependencyInjection.csproj +++ b/DisCatSharp.Hosting.DependencyInjection/DisCatSharp.Hosting.DependencyInjection.csproj @@ -18,7 +18,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp.Hosting.Tests/DisCatSharp.Hosting.Tests.csproj b/DisCatSharp.Hosting.Tests/DisCatSharp.Hosting.Tests.csproj index 722513ca9f..ffe6b8a6e4 100644 --- a/DisCatSharp.Hosting.Tests/DisCatSharp.Hosting.Tests.csproj +++ b/DisCatSharp.Hosting.Tests/DisCatSharp.Hosting.Tests.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp.Hosting/DisCatSharp.Hosting.csproj b/DisCatSharp.Hosting/DisCatSharp.Hosting.csproj index 5859e1daad..d129adceba 100644 --- a/DisCatSharp.Hosting/DisCatSharp.Hosting.csproj +++ b/DisCatSharp.Hosting/DisCatSharp.Hosting.csproj @@ -23,7 +23,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp.Interactivity/DisCatSharp.Interactivity.csproj b/DisCatSharp.Interactivity/DisCatSharp.Interactivity.csproj index 0194a560cf..36e77329c7 100644 --- a/DisCatSharp.Interactivity/DisCatSharp.Interactivity.csproj +++ b/DisCatSharp.Interactivity/DisCatSharp.Interactivity.csproj @@ -26,7 +26,7 @@ Documentation: https://docs.discatsharp.tech/articles/modules/interactivity.html - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp.Lavalink/DisCatSharp.Lavalink.csproj b/DisCatSharp.Lavalink/DisCatSharp.Lavalink.csproj index bdb27a7c4d..dde5dee762 100644 --- a/DisCatSharp.Lavalink/DisCatSharp.Lavalink.csproj +++ b/DisCatSharp.Lavalink/DisCatSharp.Lavalink.csproj @@ -31,7 +31,7 @@ Documentation: https://docs.discatsharp.tech/articles/modules/audio/lavalink/set - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp.Tools/DisCatSharp.Analyzer/DisCatSharp.Analyzer.Package/DisCatSharp.Analyzer.Package.csproj b/DisCatSharp.Tools/DisCatSharp.Analyzer/DisCatSharp.Analyzer.Package/DisCatSharp.Analyzer.Package.csproj index 571f25c644..d464466e4a 100644 --- a/DisCatSharp.Tools/DisCatSharp.Analyzer/DisCatSharp.Analyzer.Package/DisCatSharp.Analyzer.Package.csproj +++ b/DisCatSharp.Tools/DisCatSharp.Analyzer/DisCatSharp.Analyzer.Package/DisCatSharp.Analyzer.Package.csproj @@ -9,8 +9,8 @@ DisCatSharp.Analyzer.Roselyn - 5.0.0 - 5.0.0 + 5.1.0 + 5.1.0 AITSYS false DisCatSharp Analyzer diff --git a/DisCatSharp.Tools/DisCatSharp.Analyzer/DisCatSharp.Analyzer/AnalyzerReleases.Shipped.md b/DisCatSharp.Tools/DisCatSharp.Analyzer/DisCatSharp.Analyzer/AnalyzerReleases.Shipped.md index 1818faacce..4181382ce9 100644 --- a/DisCatSharp.Tools/DisCatSharp.Analyzer/DisCatSharp.Analyzer/AnalyzerReleases.Shipped.md +++ b/DisCatSharp.Tools/DisCatSharp.Analyzer/DisCatSharp.Analyzer/AnalyzerReleases.Shipped.md @@ -52,3 +52,14 @@ Rule ID | Category | Severity | Notes DCS0101 | Information | Warning | DiscordInExperiment Attribute Analyzer DCS0102 | Information | Warning | DiscordDeprecated Attribute Analyzer DCS0103 | Information | Warning | DiscordUnreleased Attribute Analyzer + + +## Release 5.1 + +### Changed Rules + +Rule ID | Category | Severity | Notes +--------|----------|----------|-------------------- +DCS0101 | Information | Warning | DiscordInExperiment Attribute Analyzer +DCS0102 | Information | Warning | DiscordDeprecated Attribute Analyzer +DCS0103 | Information | Warning | DiscordUnreleased Attribute Analyzer diff --git a/DisCatSharp.Tools/DisCatSharp.Analyzer/DisCatSharp.Analyzer/AttributeAnalyzer.cs b/DisCatSharp.Tools/DisCatSharp.Analyzer/DisCatSharp.Analyzer/AttributeAnalyzer.cs index 754c8889b8..962e9ec903 100644 --- a/DisCatSharp.Tools/DisCatSharp.Analyzer/DisCatSharp.Analyzer/AttributeAnalyzer.cs +++ b/DisCatSharp.Tools/DisCatSharp.Analyzer/DisCatSharp.Analyzer/AttributeAnalyzer.cs @@ -24,11 +24,9 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; using System; -using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; @@ -43,15 +41,15 @@ public class AttributeAnalyzer : DiagnosticAnalyzer private static readonly LocalizableString TitleExperimental = new LocalizableResourceString(nameof(Resources.AnalyzerTitleExperimental), Resources.ResourceManager, typeof(Resources)); private static readonly LocalizableString MessageFormatExperimental = new LocalizableResourceString(nameof(Resources.AnalyzerMessageFormatExperimental), Resources.ResourceManager, typeof(Resources)); private static readonly LocalizableString DescriptionExperimental = new LocalizableResourceString(nameof(Resources.AnalyzerDescriptionExperimental), Resources.ResourceManager, typeof(Resources)); - private static readonly LocalizableString TitleDiscordInExperiment = new LocalizableResourceString(nameof(Resources.AnalyzerTitleExperimental), Resources.ResourceManager, typeof(Resources)); - private static readonly LocalizableString MessageFormatDiscordInExperiment = new LocalizableResourceString(nameof(Resources.AnalyzerMessageFormatExperimental), Resources.ResourceManager, typeof(Resources)); - private static readonly LocalizableString DescriptionDiscordInExperiment = new LocalizableResourceString(nameof(Resources.AnalyzerDescriptionExperimental), Resources.ResourceManager, typeof(Resources)); - private static readonly LocalizableString TitleDiscordDeprecated = new LocalizableResourceString(nameof(Resources.AnalyzerTitleExperimental), Resources.ResourceManager, typeof(Resources)); - private static readonly LocalizableString MessageFormatDiscordDeprecated = new LocalizableResourceString(nameof(Resources.AnalyzerMessageFormatExperimental), Resources.ResourceManager, typeof(Resources)); - private static readonly LocalizableString DescriptionDiscordDeprecated = new LocalizableResourceString(nameof(Resources.AnalyzerDescriptionExperimental), Resources.ResourceManager, typeof(Resources)); - private static readonly LocalizableString TitleDiscordUnreleased = new LocalizableResourceString(nameof(Resources.AnalyzerTitleExperimental), Resources.ResourceManager, typeof(Resources)); - private static readonly LocalizableString MessageFormatDiscordUnreleased = new LocalizableResourceString(nameof(Resources.AnalyzerMessageFormatExperimental), Resources.ResourceManager, typeof(Resources)); - private static readonly LocalizableString DescriptionDiscordUnreleased = new LocalizableResourceString(nameof(Resources.AnalyzerDescriptionExperimental), Resources.ResourceManager, typeof(Resources)); + private static readonly LocalizableString TitleDiscordInExperiment = new LocalizableResourceString(nameof(Resources.AnalyzerTitleDiscordInExperiment), Resources.ResourceManager, typeof(Resources)); + private static readonly LocalizableString MessageFormatDiscordInExperiment = new LocalizableResourceString(nameof(Resources.AnalyzerMessageFormatDiscordInExperiment), Resources.ResourceManager, typeof(Resources)); + private static readonly LocalizableString DescriptionDiscordInExperiment = new LocalizableResourceString(nameof(Resources.AnalyzerDescriptionDiscordInExperiment), Resources.ResourceManager, typeof(Resources)); + private static readonly LocalizableString TitleDiscordDeprecated = new LocalizableResourceString(nameof(Resources.AnalyzerTitleDiscordDeprecated), Resources.ResourceManager, typeof(Resources)); + private static readonly LocalizableString MessageFormatDiscordDeprecated = new LocalizableResourceString(nameof(Resources.AnalyzerDescriptionDiscordDeprecated), Resources.ResourceManager, typeof(Resources)); + private static readonly LocalizableString DescriptionDiscordDeprecated = new LocalizableResourceString(nameof(Resources.AnalyzerDescriptionDiscordDeprecated), Resources.ResourceManager, typeof(Resources)); + private static readonly LocalizableString TitleDiscordUnreleased = new LocalizableResourceString(nameof(Resources.AnalyzerTitleDiscordUnreleased), Resources.ResourceManager, typeof(Resources)); + private static readonly LocalizableString MessageFormatDiscordUnreleased = new LocalizableResourceString(nameof(Resources.AnalyzerDescriptionDiscordUnreleased), Resources.ResourceManager, typeof(Resources)); + private static readonly LocalizableString DescriptionDiscordUnreleased = new LocalizableResourceString(nameof(Resources.AnalyzerDescriptionDiscordUnreleased), Resources.ResourceManager, typeof(Resources)); private static readonly DiagnosticDescriptor ExperimentalRule = new DiagnosticDescriptor(DiagnosticIdPrefix + "0001", TitleExperimental, MessageFormatExperimental, Category, DiagnosticSeverity.Warning, true, DescriptionExperimental, "https://docs.discatsharp.tech/vs/analyzer/dcs/0001.html"); private static readonly DiagnosticDescriptor DiscordInExperimentRule = new DiagnosticDescriptor(DiagnosticIdPrefix + "0101", TitleDiscordInExperiment, MessageFormatDiscordInExperiment, Category, DiagnosticSeverity.Warning, true, DescriptionDiscordInExperiment, "https://docs.discatsharp.tech/vs/analyzer/dcs/0101.html"); diff --git a/DisCatSharp.VoiceNext.Natives/DisCatSharp.VoiceNext.Natives.csproj b/DisCatSharp.VoiceNext.Natives/DisCatSharp.VoiceNext.Natives.csproj index f980076d08..66b5dcc1c7 100644 --- a/DisCatSharp.VoiceNext.Natives/DisCatSharp.VoiceNext.Natives.csproj +++ b/DisCatSharp.VoiceNext.Natives/DisCatSharp.VoiceNext.Natives.csproj @@ -32,6 +32,10 @@ Manual Download: https://docs.discatsharp.tech/natives/index.html + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/DisCatSharp.VoiceNext/DisCatSharp.VoiceNext.csproj b/DisCatSharp.VoiceNext/DisCatSharp.VoiceNext.csproj index 495756593a..fe69e02931 100644 --- a/DisCatSharp.VoiceNext/DisCatSharp.VoiceNext.csproj +++ b/DisCatSharp.VoiceNext/DisCatSharp.VoiceNext.csproj @@ -26,7 +26,7 @@ Documentation: https://docs.discatsharp.tech/articles/modules/audio/voicenext/pr - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp/DisCatSharp.csproj b/DisCatSharp/DisCatSharp.csproj index 63d978bcfd..dd36a60a18 100644 --- a/DisCatSharp/DisCatSharp.csproj +++ b/DisCatSharp/DisCatSharp.csproj @@ -24,7 +24,7 @@ Written with love and for everyone. - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DisCatSharp/Entities/Guild/DiscordGuild.Features.cs b/DisCatSharp/Entities/Guild/DiscordGuild.Features.cs index 2432e36022..1e100a8cd6 100644 --- a/DisCatSharp/Entities/Guild/DiscordGuild.Features.cs +++ b/DisCatSharp/Entities/Guild/DiscordGuild.Features.cs @@ -129,42 +129,18 @@ public GuildFeatures(DiscordGuild guild) if (guild.RawFeatures.Contains("VOICE_CHANNEL_EFFECTS")) this.Features.Add(GuildFeaturesEnum.VoiceChannelEffects); if (guild.RawFeatures.Contains("SOUNDBOARD")) this.Features.Add(GuildFeaturesEnum.Soundboard); -#pragma warning disable CS0612 // Type or member is obsolete if (guild.RawFeatures.Contains("COMMERCE")) this.Features.Add(GuildFeaturesEnum.Commerce); -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete if (guild.RawFeatures.Contains("EXPOSED_TO_BOOSTING_TIERS_EXPERIMENT")) this.Features.Add(GuildFeaturesEnum.ExposedToBoostingTiersExperiment); -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete if (guild.RawFeatures.Contains("PUBLIC_DISABLED")) this.Features.Add(GuildFeaturesEnum.PublicDisabled); -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete if (guild.RawFeatures.Contains("PUBLIC")) this.Features.Add(GuildFeaturesEnum.Public); -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete if (guild.RawFeatures.Contains("SEVEN_DAY_THREAD_ARCHIVE")) this.Features.Add(GuildFeaturesEnum.SevenDayThreadArchive); -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete if (guild.RawFeatures.Contains("THREE_DAY_THREAD_ARCHIVE")) this.Features.Add(GuildFeaturesEnum.ThreeDayThreadArchive); -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete if (guild.RawFeatures.Contains("FEATURABLE")) this.Features.Add(GuildFeaturesEnum.Featurable); -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete if (guild.RawFeatures.Contains("FORCE_RELAY")) this.Features.Add(GuildFeaturesEnum.ForceRelay); -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete if (guild.RawFeatures.Contains("LURKABLE")) this.Features.Add(GuildFeaturesEnum.Lurkable); -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete if (guild.RawFeatures.Contains("MEMBER_LIST_DISABLED")) this.Features.Add(GuildFeaturesEnum.MemberListDisabled); -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete if (guild.RawFeatures.Contains("CHANNEL_BANNER")) this.Features.Add(GuildFeaturesEnum.CanSetChannelBanner); -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete if (guild.RawFeatures.Contains("PRIVATE_THREADS")) this.Features.Add(GuildFeaturesEnum.CanCreatePrivateThreads); -#pragma warning restore CS0612 // Type or member is obsolete } ///