Skip to content

Commit

Permalink
Remove unnecessary usings (#1746)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma authored Nov 19, 2024
1 parent 7869b1e commit f86d896
Show file tree
Hide file tree
Showing 42 changed files with 13 additions and 43 deletions.
5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<Nullable>enable</Nullable>

<UseArtifactsOutput>true</UseArtifactsOutput>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

</PropertyGroup>

Expand All @@ -33,7 +34,6 @@
<AnalysisLevel>latest-Recommended</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<!--
[IDE0005] Using directive is unnecessary
[IDE0008] Use explicit type instead of 'var'
[IDE0019] Use pattern matching
[IDE0021] Use block body for constructor
Expand Down Expand Up @@ -64,9 +64,10 @@
[CA1510] Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance
[CA1716] rename parameter property so that it no longer conflicts with the reserved language keyword
[CA1720] Identifier 'xxx' contains type name
[CA1870] Use a cached 'SearchValues' instance for improved searching performance
[CA2263] Prefer the generic overload 'System.Enum.GetValues<TEnum>()'
-->
<NoWarn>$(NoWarn);IDE0005;IDE0008;IDE0019;IDE0021;IDE0022;IDE0025;IDE0027;IDE0028;IDE0029;IDE0032;IDE0039;IDE0045;IDE0046;IDE0055;IDE0057;IDE0059;IDE0060;IDE0074;IDE0078;IDE0083;IDE0090;IDE0100;IDE0130;IDE0160;IDE0260;IDE0290;IDE1005;CA1200;CA1510;CA1716;CA1720;CA2263</NoWarn>
<NoWarn>$(NoWarn);IDE0008;IDE0019;IDE0021;IDE0022;IDE0025;IDE0027;IDE0028;IDE0029;IDE0032;IDE0039;IDE0045;IDE0046;IDE0055;IDE0057;IDE0059;IDE0060;IDE0074;IDE0078;IDE0083;IDE0090;IDE0100;IDE0130;IDE0160;IDE0260;IDE0290;IDE1005;CA1200;CA1510;CA1716;CA1720;CA1870;CA2263</NoWarn>
</PropertyGroup>

</Project>
2 changes: 0 additions & 2 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Utilities.Collections;

using static Nuke.Common.Logger;
using static Nuke.Common.Tools.DotNet.DotNetTasks;

[ShutdownDotNetAfterServerBuild]
Expand Down
2 changes: 1 addition & 1 deletion src/NJsonSchema.Benchmark/NJsonSchema.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<GenerateProgramFile>false</GenerateProgramFile>
<NoWarn>$(NoWarn),xUnit1013</NoWarn>
<NoWarn>$(NoWarn),xUnit1013;CS1591</NoWarn>
<SignAssembly>false</SignAssembly>
<Nullable>disable</Nullable>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn),1587,1998,1591,618,SYSLIB0012</NoWarn>
<Nullable>disable</Nullable>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
Expand Down
1 change: 0 additions & 1 deletion src/NJsonSchema.CodeGeneration.CSharp/CSharpGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Collections.Generic;
using System.Linq;
using NJsonSchema.CodeGeneration.CSharp.Models;
using NJsonSchema.CodeGeneration.Models;

namespace NJsonSchema.CodeGeneration.CSharp
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using NJsonSchema.Annotations;
using System;
using System.Collections.Generic;
using System.Globalization;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using NJsonSchema.Annotations;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using NJsonSchema.Annotations;
using System.Globalization;
using NJsonSchema.CodeGeneration.Models;

Expand Down
1 change: 0 additions & 1 deletion src/NJsonSchema.CodeGeneration.Tests/LiquidTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
using Fluid;
using NJsonSchema.CodeGeneration.TypeScript;
using Xunit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using NJsonSchema.NewtonsoftJson.Generation;
using System;
using System.Threading.Tasks;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn),1587,1998,1591,618</NoWarn>
<Nullable>disable</Nullable>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using NJsonSchema.Annotations;
using System;

namespace NJsonSchema.CodeGeneration.TypeScript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System;
using NJsonSchema.CodeGeneration.TypeScript.Models;
using System.Linq;
using NJsonSchema.CodeGeneration.Models;
using System.Collections.Generic;

namespace NJsonSchema.CodeGeneration.TypeScript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using NJsonSchema.Annotations;
using System;
using System.Linq;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using NJsonSchema.Annotations;
using System.Collections.Generic;

namespace NJsonSchema.CodeGeneration.TypeScript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using Newtonsoft.Json;

namespace NJsonSchema.CodeGeneration
Expand Down
1 change: 1 addition & 0 deletions src/NJsonSchema.Demo/NJsonSchema.Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<OutputType>Exe</OutputType>
<StartupObject />
<Nullable>disable</Nullable>
<NoWarn>$(NoWarn);CS1591;IDE0005</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/NJsonSchema.Yaml.Tests/NJsonSchema.Yaml.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<IsPackable>false</IsPackable>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<Nullable>disable</Nullable>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/NJsonSchema.Yaml/JsonAndYamlReferenceResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ JsonReferenceResolver ReferenceResolverFactory(JsonSchema schema)

/// <summary>Resolves a file reference.</summary>
/// <param name="filePath">The file path.</param>
/// <param name="cancellationToken">The cancellation token</param>
/// <returns>The resolved JSON Schema.</returns>
/// <exception cref="NotSupportedException">The System.IO.File API is not available on this platform.</exception>
public override async Task<IJsonReference> ResolveFileReferenceAsync(string filePath, CancellationToken cancellationToken = default)
Expand All @@ -47,6 +48,7 @@ public override async Task<IJsonReference> ResolveFileReferenceAsync(string file

/// <summary>Resolves an URL reference.</summary>
/// <param name="url">The URL.</param>
/// <param name="cancellationToken">The cancellation token</param>
/// <exception cref="NotSupportedException">The HttpClient.GetAsync API is not available on this platform.</exception>
public override async Task<IJsonReference> ResolveUrlReferenceAsync(string url, CancellationToken cancellationToken = default)
{
Expand Down
3 changes: 3 additions & 0 deletions src/NJsonSchema.Yaml/JsonSchemaYaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static async Task<JsonSchema> FromYamlAsync(string data, string? document
/// <param name="data">The JSON string.</param>
/// <param name="documentPath">The document path (URL or file path) for resolving relative document references.</param>
/// <param name="referenceResolverFactory">The JSON reference resolver factory.</param>
/// <param name="cancellationToken">The cancellation token</param>
/// <returns>The JSON Schema.</returns>
public static async Task<JsonSchema> FromYamlAsync(string data, string? documentPath, Func<JsonSchema, JsonReferenceResolver> referenceResolverFactory, CancellationToken cancellationToken = default)
{
Expand Down Expand Up @@ -81,6 +82,7 @@ public static async Task<JsonSchema> FromFileAsync(string filePath)
/// <summary>Creates a JSON Schema from a JSON file.</summary>
/// <param name="filePath">The file path.</param>
/// <param name="referenceResolverFactory">The JSON reference resolver factory.</param>
/// <param name="cancellationToken">The cancellation token</param>
/// <returns>The <see cref="JsonSchema" />.</returns>
public static async Task<JsonSchema> FromFileAsync(string filePath, Func<JsonSchema, JsonReferenceResolver> referenceResolverFactory, CancellationToken cancellationToken = default)
{
Expand All @@ -91,6 +93,7 @@ public static async Task<JsonSchema> FromFileAsync(string filePath, Func<JsonSch
/// <summary>Creates a JSON Schema from an URL.</summary>
/// <param name="url">The URL.</param>
/// <param name="referenceResolverFactory">The JSON reference resolver factory.</param>
/// <param name="cancellationToken">The cancellation token</param>
/// <returns>The <see cref="JsonSchema"/>.</returns>
public static async Task<JsonSchema> FromUrlAsync(string url, Func<JsonSchema, JsonReferenceResolver> referenceResolverFactory, CancellationToken cancellationToken = default)
{
Expand Down
1 change: 0 additions & 1 deletion src/NJsonSchema/Generation/SampleJsonDataGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System;
using System.Collections.Generic;
using System.Globalization;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using System;
using System.Threading.Tasks;

namespace NJsonSchema.Generation.TypeMappers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

using System.Collections;
using System.Reflection;
using Namotion.Reflection;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

Expand Down
5 changes: 2 additions & 3 deletions src/NJsonSchema/Infrastructure/Polyfills.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;

// ReSharper disable once CheckNamespace

namespace NJsonSchema;

internal static class Polyfills
Expand All @@ -18,6 +17,6 @@ internal static class Polyfills

#if NETFRAMEWORK
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
internal static bool Contains(this ReadOnlySpan<string> source, string c) => source.IndexOf(c) != -1;
internal static bool Contains(this System.ReadOnlySpan<string> source, string c) => System.MemoryExtensions.IndexOf(source, c) != -1;
#endif
}
2 changes: 0 additions & 2 deletions src/NJsonSchema/Infrastructure/XmlObjectExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

using Namotion.Reflection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace NJsonSchema.Infrastructure
{
Expand Down
1 change: 0 additions & 1 deletion src/NJsonSchema/JsonSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
using Namotion.Reflection;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using NJsonSchema.Collections;
using NJsonSchema.Generation;
using NJsonSchema.Infrastructure;
Expand Down
1 change: 0 additions & 1 deletion src/NJsonSchema/References/JsonReferenceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using NJsonSchema.Infrastructure;
using Newtonsoft.Json;

namespace NJsonSchema.References
Expand Down
1 change: 0 additions & 1 deletion src/NJsonSchema/SampleJsonSchemaGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;

namespace NJsonSchema
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;

namespace NJsonSchema.Validation.FormatValidators
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System.Text.RegularExpressions;

namespace NJsonSchema.Validation.FormatValidators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System;
using System.Globalization;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------
using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System;
using System.Globalization;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System.Text.RegularExpressions;

namespace NJsonSchema.Validation.FormatValidators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System;

namespace NJsonSchema.Validation.FormatValidators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System.Text.RegularExpressions;

namespace NJsonSchema.Validation.FormatValidators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System.Text.RegularExpressions;

namespace NJsonSchema.Validation.FormatValidators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System;

namespace NJsonSchema.Validation.FormatValidators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System;
using System.Globalization;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System;

namespace NJsonSchema.Validation.FormatValidators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System;

namespace NJsonSchema.Validation.FormatValidators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Newtonsoft.Json.Linq;
using NJsonSchema.Annotations;
using System;

namespace NJsonSchema.Validation.FormatValidators
Expand Down

0 comments on commit f86d896

Please sign in to comment.