Skip to content

Commit

Permalink
Enable IDE0065 (Misplaced using directive) (#70919)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Jun 19, 2022
1 parent 8442a62 commit 246d9bb
Show file tree
Hide file tree
Showing 240 changed files with 1,251 additions and 1,295 deletions.
2 changes: 1 addition & 1 deletion eng/CodeAnalysis.src.globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@ dotnet_diagnostic.IDE0063.severity = silent
dotnet_diagnostic.IDE0064.severity = silent

# IDE0065: Misplaced using directive
dotnet_diagnostic.IDE0065.severity = suggestion
dotnet_diagnostic.IDE0065.severity = warning

# IDE0066: Convert switch statement to expression
dotnet_diagnostic.IDE0066.severity = suggestion
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/nativeaot/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<NoWarn>$(NoWarn);CS8602;CS8603;CS8604;CS8618;CS8625;CS8632;CS8765</NoWarn>

<!-- we should just fix -->
<NoWarn>$(NoWarn);CA1810;CA1823;CA1825;CA1852;CA2208;SA1129;SA1205;SA1400;SA1517</NoWarn>
<NoWarn>$(NoWarn);CA1810;CA1823;CA1825;CA1852;CA2208;SA1129;SA1205;SA1400;SA1517;IDE0065</NoWarn>

<!-- Arrays as attribute arguments is not CLS-compliant -->
<NoWarn>$(NoWarn);CS3016</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Diagnostics.CodeAnalysis;

namespace System.ComponentModel
{
using System;
using System.Diagnostics.CodeAnalysis;

/// <summary>
/// DesignTimeVisibileAttribute marks a component's visibility. If
/// DesignTimeVisibileAttribute.Yes is present, a visual designer can show
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections;

namespace System.Configuration
{
using Collections;

// Contains all the updates to section definitions across all location sections.
internal sealed class ConfigDefinitionUpdates
{
Expand Down
3 changes: 1 addition & 2 deletions src/libraries/System.Data.OleDb/src/OleDbConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
using SysTx = System.Transactions;

namespace System.Data.OleDb
{
using SysTx = Transactions;

// wraps the OLEDB IDBInitialize interface which represents a connection
// Notes about connection pooling
// 1. Only happens if we use the IDataInitialize or IDBPromptInitialize interfaces
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
using System.Globalization;
using System.Runtime.InteropServices;
using System.Threading;
using SysTx = System.Transactions;

namespace System.Data.OleDb
{
using SysTx = Transactions;

internal sealed class OleDbConnectionInternal : DbConnectionInternal, IDisposable
{
private static volatile OleDbServicesWrapper? idataInitialize;
Expand Down
9 changes: 4 additions & 5 deletions src/libraries/System.Data.OleDb/src/OleDbStruct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.InteropServices;

namespace System.Data.OleDb
{
#if DEBUG
using Globalization;
using Text;
using System.Globalization;
using System.Text;
#endif

namespace System.Data.OleDb
{
internal enum DBBindStatus
{
OK = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
using System.Data.ProviderBase;
using System.Diagnostics;
using System.Threading;
using SysTx = System.Transactions;

namespace System.Data.OleDb
{
using SysTx = Transactions;

public sealed partial class OleDbConnection : DbConnection
{
private static readonly DbConnectionFactory _connectionFactory = OleDbConnectionFactory.SingletonInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
using System.Runtime.Versioning;
using System.Threading;
using System.Threading.Tasks;
using SysTx = System.Transactions;

namespace System.Data.ProviderBase
{
using SysTx = Transactions;

internal sealed class DbConnectionPool
{
private enum State
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Collections;
using System.DirectoryServices;

namespace System.DirectoryServices.AccountManagement
{
using System;
using System.Collections.Generic;
using System.Collections;
using System.DirectoryServices;

internal sealed class ExtensionCacheValue
{
internal ExtensionCacheValue(object[] value)