From 84aad74f5aabbdc65c5cf184ac9484eb55dbb602 Mon Sep 17 00:00:00 2001 From: Denis Date: Sun, 4 Feb 2024 13:19:14 +0000 Subject: [PATCH] Remove Localisation , Resources.resx --- Directory.Build.props | 2 +- ...softJsonUsageAnalyzer.sln.DotSettings.user | 7 +- .../NewtonsoftJsonUsageAnalyzer.cs | 13 ++-- .../NewtonsoftJsonUsageAnalyzer.csproj | 15 ----- .../Resources.Designer.cs | 66 ------------------- .../Resources.resx | 30 --------- 6 files changed, 9 insertions(+), 124 deletions(-) delete mode 100644 NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/Resources.Designer.cs delete mode 100644 NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/Resources.resx diff --git a/Directory.Build.props b/Directory.Build.props index a61f445..f65ef98 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ false - 0.2.0 + 0.2.1 $(Version) Denis C# Roslyn detector of Newtonsoft.Json usage diff --git a/NewtonsoftJsonUsageAnalyzer.sln.DotSettings.user b/NewtonsoftJsonUsageAnalyzer.sln.DotSettings.user index 7b570fa..0b07919 100644 --- a/NewtonsoftJsonUsageAnalyzer.sln.DotSettings.user +++ b/NewtonsoftJsonUsageAnalyzer.sln.DotSettings.user @@ -1,8 +1,9 @@  <SessionState ContinuousTestingMode="0" IsActive="True" Name="SampleSyntaxAnalyzerTests" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"> <TestAncestor> - <TestId>net8.0::xUnit::E20EF578-BFA0-4DD8-895A-07927A684A66::NewtonsoftJsonUsageAnalyzer.Tests.NewtonsoftJsonUsageAnalyzerTests</TestId> + <TestId>E20EF578-BFA0-4DD8-895A-07927A684A66::net8.0::xUnit::NewtonsoftJsonUsageAnalyzer.Tests.NewtonsoftJsonUsageAnalyzerTests</TestId> </TestAncestor> </SessionState> - True - True \ No newline at end of file + + True + False \ No newline at end of file diff --git a/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer.cs b/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer.cs index 694ee72..91a76b9 100644 --- a/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer.cs +++ b/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer.cs @@ -13,18 +13,13 @@ namespace NewtonsoftJsonUsageAnalyzer; [DiagnosticAnalyzer(LanguageNames.CSharp)] public class NewtonsoftJsonUsageAnalyzer : DiagnosticAnalyzer { - public const string DiagnosticId = "NS0001"; + private const string DiagnosticId = "NS0001"; - private static readonly LocalizableString Title = new LocalizableResourceString(nameof(Resources.NS0001Title), - Resources.ResourceManager, typeof(Resources)); + private const string Title = "Code contains Newtonsoft.Json library usage"; - private static readonly LocalizableString MessageFormat = - new LocalizableResourceString(nameof(Resources.NS0001MessageFormat), Resources.ResourceManager, - typeof(Resources)); + private const string MessageFormat = "Detected Newtonsoft usage: '{0}'"; - private static readonly LocalizableString Description = - new LocalizableResourceString(nameof(Resources.NS0001Description), Resources.ResourceManager, - typeof(Resources)); + private const string Description = "Code shouldn't contain any Newtonsoft usage."; // The category of the diagnostic (Design, Naming etc.). private const string Category = "Design"; diff --git a/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer.csproj b/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer.csproj index 598e929..5cef3ca 100644 --- a/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer.csproj +++ b/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer.csproj @@ -22,19 +22,4 @@ - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - - True - True - Resources.resx - - - diff --git a/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/Resources.Designer.cs b/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/Resources.Designer.cs deleted file mode 100644 index 11d776f..0000000 --- a/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/Resources.Designer.cs +++ /dev/null @@ -1,66 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NewtonsoftJsonUsageAnalyzer { - using System; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static System.Resources.ResourceManager resourceMan; - - private static System.Globalization.CultureInfo resourceCulture; - - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Resources.ResourceManager ResourceManager { - get { - if (object.Equals(null, resourceMan)) { - System.Resources.ResourceManager temp = new System.Resources.ResourceManager("NewtonsoftJsonUsageAnalyzer.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - internal static string NS0001Description { - get { - return ResourceManager.GetString("NS0001Description", resourceCulture); - } - } - - internal static string NS0001MessageFormat { - get { - return ResourceManager.GetString("NS0001MessageFormat", resourceCulture); - } - } - - internal static string NS0001Title { - get { - return ResourceManager.GetString("NS0001Title", resourceCulture); - } - } - } -} diff --git a/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/Resources.resx b/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/Resources.resx deleted file mode 100644 index bcc5325..0000000 --- a/NewtonsoftJsonUsageAnalyzer/NewtonsoftJsonUsageAnalyzer/Resources.resx +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Code shouldn't contain any Newtonsoft usage. - - - Detected Newtonsoft usage: '{0}' - - - Code contains Newtonsoft.Json library usage - - \ No newline at end of file