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

Treating unnecessary usings as warnings #1074

Merged
merged 8 commits into from
Mar 8, 2025
Merged
Show file tree
Hide file tree
Changes from 7 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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ dotnet_diagnostic.CA1866.severity = warning
dotnet_diagnostic.CA1867.severity = warning

# Usage rules
# Treat unnecessary usings as warnings
dotnet_diagnostic.IDE0005.severity = warning

# CA2254: Template should be a static expression
dotnet_diagnostic.CA2254.severity = warning

Expand Down
2 changes: 0 additions & 2 deletions benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Garnet.common;
using Garnet.networking;
using Microsoft.Extensions.Logging;
Expand Down
2 changes: 0 additions & 2 deletions benchmark/BDN.benchmark/Embedded/EmbeddedRespServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
// Licensed under the MIT license.

using Garnet;
using Garnet.common;
using Garnet.server;
using Microsoft.Extensions.Logging;
using Tsavorite.core;

namespace Embedded.server
{
Expand Down
2 changes: 0 additions & 2 deletions benchmark/BDN.benchmark/Embedded/GarnetServerEmbedded.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.Net;
using System.Net.Security;
using System.Threading;
using Garnet.common;
using Garnet.networking;
using Garnet.server;
Expand Down
1 change: 0 additions & 1 deletion benchmark/Resp.benchmark/RespOnlineBench.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT license.

using System;
using System.Buffers;
using System.Diagnostics;
using System.Linq;
using System.Net;
Expand Down
1 change: 0 additions & 1 deletion libs/common/Logging/FileLoggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT license.

using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using Microsoft.Extensions.Logging;
Expand Down
1 change: 0 additions & 1 deletion libs/host/Configuration/Redis/RedisTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT license.

using System.ComponentModel;
using Garnet.server.Auth.Settings;

namespace Garnet
{
Expand Down
1 change: 0 additions & 1 deletion libs/server/ACL/CommandPermissionSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;

namespace Garnet.server.ACL
Expand Down
1 change: 0 additions & 1 deletion libs/server/Auth/Aad/IssuerSigningTokenProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Protocols;
Expand Down
4 changes: 0 additions & 4 deletions libs/server/Auth/GarnetAclWithAadAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// Licensed under the MIT license.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Garnet.server.ACL;
using Microsoft.Extensions.Logging;

Expand Down
3 changes: 0 additions & 3 deletions libs/server/Auth/GarnetAclWithPasswordAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
// Licensed under the MIT license.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Garnet.server.ACL;
using Microsoft.Extensions.Logging;

Expand Down
1 change: 0 additions & 1 deletion libs/server/Custom/CustomObjectBase.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System.IO;
using Tsavorite.core;

namespace Garnet.server
{
Expand Down
1 change: 0 additions & 1 deletion libs/server/Lua/LuaStateWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using Garnet.common;
using KeraLua;
using Microsoft.Extensions.Logging;
Expand Down
1 change: 0 additions & 1 deletion libs/server/Lua/SessionScriptCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Threading;
using Garnet.server.ACL;
using Garnet.server.Auth;
using Garnet.server.Lua;
Expand Down
2 changes: 0 additions & 2 deletions libs/server/Metrics/Latency/RespLatencyCommands.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.Collections.Generic;
using System.Linq;
using Garnet.common;

namespace Garnet.server
Expand Down
1 change: 0 additions & 1 deletion libs/server/Objects/Hash/HashObjectImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Buffers.Text;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text;
using Garnet.common;
using Tsavorite.core;
Expand Down
2 changes: 0 additions & 2 deletions libs/server/Objects/ItemBroker/CollectionItemBrokerEvent.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using Tsavorite.core;

namespace Garnet.server
{
/// <summary>
Expand Down
1 change: 0 additions & 1 deletion libs/server/Objects/Types/GarnetObjectBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.IO;
using System.Text;
using System.Threading;
using Tsavorite.core;

namespace Garnet.server
{
Expand Down
1 change: 0 additions & 1 deletion libs/server/Objects/Types/IGarnetObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using Tsavorite.core;

namespace Garnet.server
{
Expand Down
1 change: 0 additions & 1 deletion libs/server/Providers/TsavoriteKVProviderBase.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using Garnet.common;
using Garnet.networking;
using Tsavorite.core;

Expand Down
1 change: 0 additions & 1 deletion libs/server/Resp/Parser/SessionParseState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using Garnet.common;
using Garnet.common.Parsing;
using Tsavorite.core;
Expand Down
1 change: 0 additions & 1 deletion libs/server/Resp/RespCommandInfoFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.ComponentModel;
using System.Net.NetworkInformation;

namespace Garnet.server
{
Expand Down
1 change: 0 additions & 1 deletion libs/server/Servers/MetricsApi.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.Collections.Generic;
using Garnet.common;

Expand Down
1 change: 0 additions & 1 deletion libs/server/Storage/Functions/MainStore/ReadMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System.Buffers;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using Garnet.common;
using Tsavorite.core;

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

using System;
using System.Collections.Generic;
using System.Linq;
using Tsavorite.core;

namespace Garnet.server
Expand Down
1 change: 0 additions & 1 deletion libs/server/Storage/Session/MainStore/HyperLogLogOps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Diagnostics;
using System.Text;
using Tsavorite.core;

namespace Garnet.server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// Licensed under the MIT license.

using System;
using System.Linq;
using System.Text;
using System.Threading;

Check failure on line 6 in libs/storage/Tsavorite/cs/src/core/Index/Recovery/Checkpoint.cs

View workflow job for this annotation

GitHub Actions / Format Tsavorite

Using directive is unnecessary.

Check failure on line 6 in libs/storage/Tsavorite/cs/src/core/Index/Recovery/Checkpoint.cs

View workflow job for this annotation

GitHub Actions / Format Garnet

Using directive is unnecessary.
using System.Threading.Tasks;

namespace Tsavorite.core
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;

namespace Tsavorite.core
{
/// <summary>
Expand Down
1 change: 0 additions & 1 deletion libs/storage/Tsavorite/cs/test/BasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.IO;
using System.Linq;
using NUnit.Framework;
using NUnit.Framework.Internal;
using NUnit.Framework.Legacy;
using Tsavorite.core;
using static Tsavorite.test.TestUtils;
Expand Down
1 change: 0 additions & 1 deletion libs/storage/Tsavorite/cs/test/DeviceLogTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.Buffers;
using System.IO;
using System.Linq;
Expand Down
1 change: 0 additions & 1 deletion libs/storage/Tsavorite/cs/test/LogScanTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.IO;
using System.Threading;
using NUnit.Framework;
Expand Down
1 change: 0 additions & 1 deletion libs/storage/Tsavorite/cs/test/LogShiftTailStressTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Threading;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using Tsavorite.core;

namespace Tsavorite.test
Expand Down
2 changes: 0 additions & 2 deletions libs/storage/Tsavorite/cs/test/ObjectRecoveryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
// Licensed under the MIT license.

using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using Tsavorite.core;

namespace Tsavorite.test.recovery.objects
Expand Down
1 change: 0 additions & 1 deletion libs/storage/Tsavorite/cs/test/ObjectRecoveryTest2.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.IO;
using System.Threading.Tasks;
using NUnit.Framework;
Expand Down
1 change: 0 additions & 1 deletion libs/storage/Tsavorite/cs/test/ObjectTestTypes.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using NUnit.Framework;
using NUnit.Framework.Legacy;
using Tsavorite.core;

Expand Down
1 change: 0 additions & 1 deletion libs/storage/Tsavorite/cs/test/SharedDirectoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Threading.Tasks;
using Microsoft.Win32.SafeHandles;
using NUnit.Framework;
using NUnit.Framework.Internal;
using NUnit.Framework.Legacy;
using Tsavorite.core;

Expand Down
1 change: 0 additions & 1 deletion libs/storage/Tsavorite/cs/test/SpanByteTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using NUnit.Framework;
using NUnit.Framework.Legacy;
Expand Down
1 change: 0 additions & 1 deletion libs/storage/Tsavorite/cs/test/TestTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Threading;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using Tsavorite.core;

Expand Down
1 change: 0 additions & 1 deletion libs/storage/Tsavorite/cs/test/TestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
Expand Down
1 change: 0 additions & 1 deletion libs/storage/Tsavorite/cs/test/VLVector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Runtime.CompilerServices;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using Tsavorite.core;

Expand Down
1 change: 0 additions & 1 deletion main/GarnetServer/Extensions/DeleteIfMatch.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.Buffers;
using System.Diagnostics;
using Garnet.server;
Expand Down
1 change: 0 additions & 1 deletion main/GarnetServer/Extensions/GetTwoKeysNoTxn.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using Garnet.common;
using Garnet.server;

Expand Down
2 changes: 0 additions & 2 deletions main/GarnetServer/Extensions/MGetIfPM.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.Collections.Generic;
using Garnet.common;
using Garnet.server;

Expand Down
1 change: 0 additions & 1 deletion main/GarnetServer/Extensions/MSetPx.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using Garnet.common;
using Garnet.server;

Expand Down
1 change: 0 additions & 1 deletion main/GarnetServer/Extensions/MyDictGet.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.Buffers;
using System.Diagnostics;
using Garnet.server;
Expand Down
3 changes: 0 additions & 3 deletions main/GarnetServer/Extensions/MyDictObject.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using Garnet.server;
using Tsavorite.core;

Expand Down
Loading
Loading