Skip to content

Commit bf10ef5

Browse files
committed
NCO-56 fix warnings in build
* Added .editorconfig - can extend this as needed * Ran dotnet format, fixing whietspace, unused usings, etc... * Fixed other warnings as well * Removed redundant package references (since we are .NET 10 only) * Unused import in proto files remain until we go to the source of the files and fix them there
1 parent 164ccfc commit bf10ef5

131 files changed

Lines changed: 859 additions & 857 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

fit/Couchbase.Analytics.Performer/Couchbase.Analytics.Performer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>

fit/Couchbase.Analytics.Performer/Internal/Connections/ClusterConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ public void Dispose()
4040
_cluster?.Dispose();
4141
}
4242
}
43-
}
43+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
namespace Couchbase.Analytics.Performer.Internal.Exceptions;
22

3-
public class GrpcUnimplementedException : Exception;
3+
public class GrpcUnimplementedException : Exception;

fit/Couchbase.Analytics.Performer/Internal/Logging/LoggingUtils.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ public static LogEventLevel ParseLogLevelOrDefault(string? value, LogEventLevel
5050
return serilogLevel;
5151
}
5252

53-
if (Enum.TryParse<Microsoft.Extensions.Logging.LogLevel>(value, true, out var msLevel))
53+
if (Enum.TryParse<LogLevel>(value, true, out var msLevel))
5454
{
5555
return msLevel switch
5656
{
57-
Microsoft.Extensions.Logging.LogLevel.Trace => LogEventLevel.Verbose,
58-
Microsoft.Extensions.Logging.LogLevel.Debug => LogEventLevel.Debug,
59-
Microsoft.Extensions.Logging.LogLevel.Information => LogEventLevel.Information,
60-
Microsoft.Extensions.Logging.LogLevel.Warning => LogEventLevel.Warning,
61-
Microsoft.Extensions.Logging.LogLevel.Error => LogEventLevel.Error,
62-
Microsoft.Extensions.Logging.LogLevel.Critical => LogEventLevel.Fatal,
57+
LogLevel.Trace => LogEventLevel.Verbose,
58+
LogLevel.Debug => LogEventLevel.Debug,
59+
LogLevel.Information => LogEventLevel.Information,
60+
LogLevel.Warning => LogEventLevel.Warning,
61+
LogLevel.Error => LogEventLevel.Error,
62+
LogLevel.Critical => LogEventLevel.Fatal,
6363
_ => defaultLevel
6464
};
6565
}
6666

6767
return defaultLevel;
6868
}
69-
}
69+
}

fit/Couchbase.Analytics.Performer/Internal/Modes/Mode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ public enum Mode
44
{
55
PushBasedStreaming,
66
Buffered,
7-
}
7+
}

fit/Couchbase.Analytics.Performer/Internal/Services/AnalyticsPerformerCrossService.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
using Couchbase.Analytics.Performer.Internal.Utils;
66
using Couchbase.AnalyticsClient.Options;
77
using Couchbase.AnalyticsClient.Results;
8-
using Couchbase.Grpc.Protocol.Columnar;
98
using Couchbase.Core.Utils;
9+
using Couchbase.Grpc.Protocol.Columnar;
1010
using Google.Protobuf.WellKnownTypes;
1111
using Grpc.Core;
1212
using Error = Couchbase.Grpc.Protocol.Columnar.Error;
@@ -64,7 +64,8 @@ public override Task<ExecuteQueryResponse> ExecuteQuery(ExecuteQueryRequest requ
6464

6565
_ongoingQueries.TryAdd(queryHandle, performerQuery);
6666

67-
var response = new ExecuteQueryResponse(){
67+
var response = new ExecuteQueryResponse()
68+
{
6869
QueryHandle = queryHandle,
6970
Metadata = new ResponseMetadata
7071
{
@@ -179,7 +180,7 @@ public override Task<EmptyResultOrFailureResponse> QueryCancel(QueryCancelReques
179180
performerQuery.CancellationTokenSource?.Cancel();
180181
response.EmptySuccess = true;
181182
}
182-
catch (System.Exception ex)
183+
catch (Exception)
183184
{
184185
//TODO: Map exceptions?
185186
response.Error = new Error();
@@ -220,7 +221,8 @@ public override async Task<QueryResultMetadataResponse> QueryMetadata(QueryMetad
220221
ElapsedNanos = (long)stopwatch.Elapsed.TotalNanoseconds,
221222
Initiated = initiated
222223
};
223-
} catch (Exception ex)
224+
}
225+
catch (Exception ex)
224226
{
225227
response = new QueryResultMetadataResponse();
226228
response.Failure = ex.ToProtoError();
@@ -266,4 +268,4 @@ public override Task<EmptyResultOrFailureResponse> CloseAllQueryResults(CloseAll
266268

267269
return Task.FromResult(response);
268270
}
269-
}
271+
}

fit/Couchbase.Analytics.Performer/Internal/Services/AnalyticsPerformerService.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
using Couchbase.Analytics.Performer.Internal.Modes;
55
using Couchbase.Analytics.Performer.Internal.Utils;
66
using Couchbase.AnalyticsClient;
7+
using Couchbase.Core.Utils;
78
using Couchbase.Grpc.Protocol.Columnar;
89
using Couchbase.Grpc.Protocol.Shared;
9-
using Couchbase.Core.Utils;
1010
using Google.Protobuf.WellKnownTypes;
1111
using Grpc.Core;
1212
using Exception = System.Exception;
1313

1414
namespace Couchbase.Analytics.Performer.Internal.Services;
1515

16-
internal class AnalyticsPerformerService: ColumnarService.ColumnarServiceBase
16+
internal class AnalyticsPerformerService : ColumnarService.ColumnarServiceBase
1717
{
1818
public AnalyticsPerformerService(ConcurrentDictionary<string, ClusterConnection> clusters)
1919
{
@@ -51,19 +51,19 @@ public override Task<EmptyResultOrFailureResponse> ClusterNewInstance(ClusterNew
5151
return new(request, cluster);
5252
});
5353

54-
/* context.GetHttpContext().Response.OnCompleted(() =>
55-
{
56-
foreach (var tunable in request.Tunables)
57-
{
58-
Environment.SetEnvironmentVariable(tunable.Key, null);
59-
}
54+
/* context.GetHttpContext().Response.OnCompleted(() =>
55+
{
56+
foreach (var tunable in request.Tunables)
57+
{
58+
Environment.SetEnvironmentVariable(tunable.Key, null);
59+
}
6060
61-
return Task.CompletedTask;
62-
});*/
61+
return Task.CompletedTask;
62+
});*/
6363

64-
Serilog.Log.Information(
65-
"Created or using new cluster instance in {Seconds}: {ConnectionString}",
66-
stopWatch.Elapsed, request.ConnectionString);
64+
Serilog.Log.Information(
65+
"Created or using new cluster instance in {Seconds}: {ConnectionString}",
66+
stopWatch.Elapsed, request.ConnectionString);
6767

6868
response.GetResponseMetaData(stopWatch, initiated);
6969
}
@@ -232,7 +232,7 @@ public override Task<EmptyResultOrFailureResponse> CloseAllClusters(CloseAllColu
232232

233233
public override Task<EchoResponse> Echo(EchoRequest request, ServerCallContext context)
234234
{
235-
Serilog.Log.Information("Calling Echo - {TestName} | {Message}",request.TestName, request.Message);
235+
Serilog.Log.Information("Calling Echo - {TestName} | {Message}", request.TestName, request.Message);
236236
return Task.FromResult(new EchoResponse());
237237
}
238-
}
238+
}

fit/Couchbase.Analytics.Performer/Internal/Utils/ClusterNewInstanceRequestExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static ClusterOptions ToSdkQueryOptions(this ClusterNewInstanceRequest re
4444
return clusterOptions;
4545
}
4646

47-
private static TimeoutOptions ToCore(this Couchbase.Grpc.Protocol.Columnar.ClusterNewInstanceRequest.Types.Options.Types.TimeoutOptions? protoTimeout)
47+
private static TimeoutOptions ToCore(this ClusterNewInstanceRequest.Types.Options.Types.TimeoutOptions? protoTimeout)
4848
{
4949
var timeoutOptions = new TimeoutOptions();
5050
if (protoTimeout is null) return timeoutOptions;
@@ -65,7 +65,7 @@ private static TimeoutOptions ToCore(this Couchbase.Grpc.Protocol.Columnar.Clust
6565
}
6666

6767
private static SecurityOptions ToCore(
68-
this Couchbase.Grpc.Protocol.Columnar.ClusterNewInstanceRequest.Types.Options.Types.SecurityOptions? protoSecurity)
68+
this ClusterNewInstanceRequest.Types.Options.Types.SecurityOptions? protoSecurity)
6969
{
7070
var securityOptions = new SecurityOptions();
7171
if (protoSecurity is null) return securityOptions;
@@ -74,7 +74,7 @@ private static SecurityOptions ToCore(
7474
{
7575
// what is this?
7676
}
77-
else if(protoSecurity.HasTrustOnlyCapella)
77+
else if (protoSecurity.HasTrustOnlyCapella)
7878
{
7979
securityOptions = securityOptions.WithTrustOnlyCapella();
8080
}
@@ -105,4 +105,4 @@ private static SecurityOptions ToCore(
105105
}
106106

107107

108-
}
108+
}

fit/Couchbase.Analytics.Performer/Internal/Utils/ContentAsExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Couchbase.Analytics.Performer.Internal.Utils;
88

99
public static class ContentAsExtensions
1010
{
11-
public static ContentWas ContentAsToAnalyticsRow(this AnalyticsRow analyticsRow, Couchbase.Grpc.Protocol.Columnar.ContentAs contentAs)
11+
public static ContentWas ContentAsToAnalyticsRow(this AnalyticsRow analyticsRow, ContentAs contentAs)
1212
{
1313
switch (contentAs.AsCase)
1414
{
@@ -79,4 +79,4 @@ private static Value ConvertJsonToProtoValue(JsonElement element)
7979
return new Value { NullValue = NullValue.NullValue };
8080
}
8181
}
82-
}
82+
}

fit/Couchbase.Analytics.Performer/Internal/Utils/EmptyResultOrFailureResponseExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Couchbase.Grpc.Protocol.Columnar;
21
using Couchbase.Core.Utils;
2+
using Couchbase.Grpc.Protocol.Columnar;
33
using Google.Protobuf.WellKnownTypes;
44

55
namespace Couchbase.Analytics.Performer.Internal.Utils;
@@ -28,4 +28,4 @@ public static EmptyResultOrFailureResponse GetResponseMetaData(this EmptyResultO
2828

2929
return emptyResultOrFailureResponse;
3030
}
31-
}
31+
}

0 commit comments

Comments
 (0)