mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-19 09:35:36 -05:00
Add linting for copyright and unused usings (#1416)
* Add linting for copyright and unused usings * Add one more + comment * Enforce in build and fix errors * Fix build
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using Microsoft.Data.SqlClient;
|
||||
@@ -12,15 +13,15 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall
|
||||
internal interface IFirewallErrorParser
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses given error message and error code to see if it's firewall rule error
|
||||
/// Parses given error message and error code to see if it's firewall rule error
|
||||
/// and finds the blocked ip address
|
||||
/// </summary>
|
||||
FirewallParserResponse ParseErrorMessage(string errorMessage, int errorCode);
|
||||
|
||||
/// <summary>
|
||||
/// Parses given error message and error code to see if it's firewall rule error
|
||||
/// Parses given error message and error code to see if it's firewall rule error
|
||||
/// and finds the blocked ip address
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
FirewallParserResponse ParseException(SqlException sqlException);
|
||||
}
|
||||
|
||||
@@ -30,9 +31,9 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall
|
||||
public class FirewallErrorParser : IFirewallErrorParser
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses given error message and error code to see if it's firewall rule error
|
||||
/// Parses given error message and error code to see if it's firewall rule error
|
||||
/// and finds the blocked ip address
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
public FirewallParserResponse ParseException(SqlException sqlException)
|
||||
{
|
||||
CommonUtil.CheckForNull(sqlException, "sqlException");
|
||||
@@ -40,9 +41,9 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parses given error message and error code to see if it's firewall rule error
|
||||
/// Parses given error message and error code to see if it's firewall rule error
|
||||
/// and finds the blocked ip address
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
public FirewallParserResponse ParseErrorMessage(string errorMessage, int errorCode)
|
||||
{
|
||||
CommonUtil.CheckForNull(errorMessage, "errorMessage");
|
||||
@@ -62,7 +63,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall
|
||||
|
||||
/// <summary>
|
||||
/// Parses the given message to find the blocked ip address
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
private static bool TryParseClientIp(string message, out IPAddress clientIp)
|
||||
{
|
||||
clientIp = null;
|
||||
@@ -91,7 +92,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if given error code is firewall rule blocked error code
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
private bool IsSqlAzureFirewallBlocked(int errorCode)
|
||||
{
|
||||
return errorCode == SqlAzureFirewallBlockedErrorNumber;
|
||||
|
||||
Reference in New Issue
Block a user