Skip to content

Commit 57c0fe7

Browse files
committed
fix SA1400
1 parent 0afcbbc commit 57c0fe7

File tree

10 files changed

+34
-34
lines changed

10 files changed

+34
-34
lines changed

examples/namespace/Namespace.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
namespace @namespace
88
{
9-
class NamespaceExample
9+
internal class NamespaceExample
1010
{
11-
static void ListNamespaces(IKubernetes client)
11+
private static void ListNamespaces(IKubernetes client)
1212
{
1313
var list = client.ListNamespace();
1414
foreach (var item in list.Items)
@@ -22,7 +22,7 @@ static void ListNamespaces(IKubernetes client)
2222
}
2323
}
2424

25-
static async Task DeleteAsync(IKubernetes client, string name, int delayMillis)
25+
private static async Task DeleteAsync(IKubernetes client, string name, int delayMillis)
2626
{
2727
while (true)
2828
{
@@ -59,7 +59,7 @@ static async Task DeleteAsync(IKubernetes client, string name, int delayMillis)
5959
}
6060
}
6161

62-
static void Delete(IKubernetes client, string name, int delayMillis)
62+
private static void Delete(IKubernetes client, string name, int delayMillis)
6363
{
6464
DeleteAsync(client, name, delayMillis).Wait();
6565
}

gen/KubernetesWatchGenerator/Program.cs

+18-18
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
namespace KubernetesWatchGenerator
1313
{
14-
class Program
14+
internal class Program
1515
{
1616
private static HashSet<string> _classesWithValidation;
17-
static readonly Dictionary<string, string> ClassNameMap = new Dictionary<string, string>();
17+
private static readonly Dictionary<string, string> ClassNameMap = new Dictionary<string, string>();
1818
private static Dictionary<JsonSchema4, string> _schemaToNameMap;
1919
private static HashSet<string> _schemaDefinitionsInMultipleGroups;
2020
private static Dictionary<string, string> _classNameToPluralMap;
2121

22-
static async Task Main(string[] args)
22+
private static async Task Main(string[] args)
2323
{
2424
if (args.Length < 2)
2525
{
@@ -167,7 +167,7 @@ static async Task Main(string[] args)
167167

168168
}
169169

170-
static void ToXmlDoc(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
170+
private static void ToXmlDoc(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
171171
RenderBlock fn, RenderBlock inverse)
172172
{
173173
if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is string)
@@ -195,7 +195,7 @@ static void ToXmlDoc(RenderContext context, IList<object> arguments, IDictionary
195195
}
196196
}
197197

198-
static void GetTuple(RenderContext context, IList<object> arguments, IDictionary<string, object> options, RenderBlock fn, RenderBlock inverse)
198+
private static void GetTuple(RenderContext context, IList<object> arguments, IDictionary<string, object> options, RenderBlock fn, RenderBlock inverse)
199199
{
200200
if (arguments != null && arguments.Count > 0 && arguments[0] is ITuple && options.TryGetValue("index", out var indexObj) && int.TryParse(indexObj?.ToString(), out var index))
201201
{
@@ -205,7 +205,7 @@ static void GetTuple(RenderContext context, IList<object> arguments, IDictionary
205205
}
206206
}
207207

208-
static void GetClassName(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
208+
private static void GetClassName(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
209209
RenderBlock fn, RenderBlock inverse)
210210
{
211211
if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is SwaggerOperation)
@@ -218,7 +218,7 @@ static void GetClassName(RenderContext context, IList<object> arguments, IDictio
218218
}
219219
}
220220

221-
static string GetClassName(SwaggerOperation watchOperation)
221+
private static string GetClassName(SwaggerOperation watchOperation)
222222
{
223223
var groupVersionKind =
224224
(Dictionary<string, object>)watchOperation.ExtensionData["x-kubernetes-group-version-kind"];
@@ -251,7 +251,7 @@ private static void GetInterfaceName(RenderContext context, IList<object> argume
251251
}
252252
}
253253

254-
static string GetClassNameForSchemaDefinition(JsonSchema4 definition)
254+
private static string GetClassNameForSchemaDefinition(JsonSchema4 definition)
255255
{
256256
if (definition.ExtensionData != null &&
257257
definition.ExtensionData.ContainsKey("x-kubernetes-group-version-kind"))
@@ -274,7 +274,7 @@ static string GetClassNameForSchemaDefinition(JsonSchema4 definition)
274274
return className;
275275
}
276276

277-
static string GetInterfaceName(JsonSchema4 definition)
277+
private static string GetInterfaceName(JsonSchema4 definition)
278278
{
279279
var groupVersionKindElements = (object[])definition.ExtensionData["x-kubernetes-group-version-kind"];
280280
var groupVersionKind = (Dictionary<string, object>)groupVersionKindElements[0];
@@ -315,7 +315,7 @@ static string GetInterfaceName(JsonSchema4 definition)
315315
return result;
316316
}
317317

318-
static void GetKind(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
318+
private static void GetKind(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
319319
RenderBlock fn, RenderBlock inverse)
320320
{
321321
if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is JsonSchema4)
@@ -332,7 +332,7 @@ private static string GetKind(JsonSchema4 definition)
332332
return groupVersionKind["kind"] as string;
333333
}
334334

335-
static void GetPlural(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
335+
private static void GetPlural(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
336336
RenderBlock fn, RenderBlock inverse)
337337
{
338338
if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is JsonSchema4)
@@ -355,7 +355,7 @@ private static string GetPlural(JsonSchema4 definition)
355355
return _classNameToPluralMap.GetValueOrDefault(className, null);
356356
}
357357

358-
static void GetGroup(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
358+
private static void GetGroup(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
359359
RenderBlock fn, RenderBlock inverse)
360360
{
361361
if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is JsonSchema4)
@@ -372,7 +372,7 @@ private static string GetGroup(JsonSchema4 definition)
372372
return groupVersionKind["group"] as string;
373373
}
374374

375-
static void GetMethodName(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
375+
private static void GetMethodName(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
376376
RenderBlock fn, RenderBlock inverse)
377377
{
378378
if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is SwaggerOperation)
@@ -381,7 +381,7 @@ static void GetMethodName(RenderContext context, IList<object> arguments, IDicti
381381
}
382382
}
383383

384-
static string GetMethodName(SwaggerOperation watchOperation)
384+
private static string GetMethodName(SwaggerOperation watchOperation)
385385
{
386386
var tag = watchOperation.Tags[0];
387387
tag = tag.Replace("_", string.Empty);
@@ -394,7 +394,7 @@ static string GetMethodName(SwaggerOperation watchOperation)
394394
return methodName;
395395
}
396396

397-
static void GetDotNetType(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
397+
private static void GetDotNetType(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
398398
RenderBlock fn, RenderBlock inverse)
399399
{
400400
if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is SwaggerParameter)
@@ -455,7 +455,7 @@ private static string GetDotNetType(JsonObjectType jsonType, string name, bool r
455455
}
456456
}
457457

458-
static void GetDotNetName(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
458+
private static void GetDotNetName(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
459459
RenderBlock fn, RenderBlock inverse)
460460
{
461461
if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is SwaggerParameter)
@@ -484,7 +484,7 @@ private static string GetDotNetName(string jsonName)
484484
return jsonName;
485485
}
486486

487-
static void GetPathExpression(RenderContext context, IList<object> arguments,
487+
private static void GetPathExpression(RenderContext context, IList<object> arguments,
488488
IDictionary<string, object> options, RenderBlock fn, RenderBlock inverse)
489489
{
490490
if (arguments != null && arguments.Count > 0 && arguments[0] != null &&
@@ -508,7 +508,7 @@ private static string GetPathExpression(SwaggerOperationDescription operation)
508508
return pathExpression;
509509
}
510510

511-
static void GetApiVersion(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
511+
private static void GetApiVersion(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
512512
RenderBlock fn, RenderBlock inverse)
513513
{
514514
if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is JsonSchema4)

src/KubernetesClient/Versioning/KubernetesVersionComparer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace k8s.Versioning
77
public class KubernetesVersionComparer : IComparer<string>
88
{
99
public static KubernetesVersionComparer Instance { get; private set; }
10-
static readonly Regex _kubernetesVersionRegex;
10+
private static readonly Regex _kubernetesVersionRegex;
1111

1212
static KubernetesVersionComparer()
1313
{

tests/KubernetesClient.Tests/Logging/TestOutputLogger.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace k8s.Tests.Logging
88
/// <summary>
99
/// An implementation of <see cref="ILogger"/> that writes to the output of the current Xunit test.
1010
/// </summary>
11-
sealed class TestOutputLogger
11+
internal sealed class TestOutputLogger
1212
: ILogger
1313
{
1414
/// <summary>

tests/KubernetesClient.Tests/Logging/TestOutputLoggerProvider.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace k8s.Tests.Logging
77
/// <summary>
88
/// Logger provider for logging to Xunit test output.
99
/// </summary>
10-
sealed class TestOutputLoggerProvider
10+
internal sealed class TestOutputLoggerProvider
1111
: ILoggerProvider
1212
{
1313
/// <summary>
@@ -40,7 +40,7 @@ public void Dispose()
4040
/// <summary>
4141
/// The output for the current test.
4242
/// </summary>
43-
ITestOutputHelper TestOutput { get; }
43+
private ITestOutputHelper TestOutput { get; }
4444

4545
/// <summary>
4646
/// The logger's minimum log level.

tests/KubernetesClient.Tests/Mock/Server/Controllers/PodExecController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public PodExecController(WebSocketTestAdapter webSocketTestAdapter)
3232
/// <summary>
3333
/// The adapter used to capture sockets accepted by the test server and provide them to the calling test.
3434
/// </summary>
35-
WebSocketTestAdapter WebSocketTestAdapter { get; }
35+
private WebSocketTestAdapter WebSocketTestAdapter { get; }
3636

3737
/// <summary>
3838
/// Mock Kubernetes API: exec-in-pod.

tests/KubernetesClient.Tests/Mock/Server/Controllers/PodPortForwardController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public PodPortForwardController(WebSocketTestAdapter webSocketTestAdapter)
3333
/// <summary>
3434
/// The adapter used to capture sockets accepted by the test server and provide them to the calling test.
3535
/// </summary>
36-
WebSocketTestAdapter WebSocketTestAdapter { get; }
36+
private WebSocketTestAdapter WebSocketTestAdapter { get; }
3737

3838
/// <summary>
3939
/// Mock Kubernetes API: port-forward for pod.

tests/KubernetesClient.Tests/Mock/Server/WebSocketTestAdapter.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class WebSocketTestAdapter
1818
/// <summary>
1919
/// Completion source for the <see cref="TestCompleted"/> task.
2020
/// </summary>
21-
readonly TaskCompletionSource<object> _testCompletion = new TaskCompletionSource<object>();
21+
private readonly TaskCompletionSource<object> _testCompletion = new TaskCompletionSource<object>();
2222

2323
/// <summary>
2424
/// A <see cref="Task"/> that completes when the test is complete (providing <see cref="CompleteTest"/> is called).
@@ -51,7 +51,7 @@ public class ServerSocketAcceptance
5151
/// <summary>
5252
/// Completion source for the <see cref="ServerSocketAccepted"/> task.
5353
/// </summary>
54-
readonly TaskCompletionSource<WebSocket> _completion = new TaskCompletionSource<WebSocket>();
54+
private readonly TaskCompletionSource<WebSocket> _completion = new TaskCompletionSource<WebSocket>();
5555

5656
/// <summary>
5757
/// A <see cref="Task"/> that completes when the server accepts a WebSocket connection (i.e. when <see cref="AcceptServerSocket"/> or <see cref="RejectServerSocket"/> is called).

tests/KubernetesClient.Tests/TaskAssert.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace k8s.Tests
77
{
8-
static class TaskAssert
8+
internal static class TaskAssert
99
{
1010
public static void NotCompleted(Task task, string message = "Task should not be completed")
1111
{

tests/KubernetesClient.Tests/WebSocketTestBase.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public abstract class WebSocketTestBase : IDisposable
2424
/// <summary>
2525
/// The next server port to use.
2626
/// </summary>
27-
static int NextPort = 13255;
27+
private static int NextPort = 13255;
2828

2929
private readonly ITestOutputHelper testOutput;
3030

@@ -335,7 +335,7 @@ protected class AnonymousClientCredentials
335335
/// <summary>
336336
/// Create new <see cref="AnonymousClientCredentials"/>.
337337
/// </summary>
338-
AnonymousClientCredentials()
338+
private AnonymousClientCredentials()
339339
{
340340
}
341341
}
@@ -348,7 +348,7 @@ protected static class EventIds
348348
/// <summary>
349349
/// An error occurred while closing the server-side socket.
350350
/// </summary>
351-
static readonly EventId ErrorClosingServerSocket = new EventId(1000, nameof(ErrorClosingServerSocket));
351+
private static readonly EventId ErrorClosingServerSocket = new EventId(1000, nameof(ErrorClosingServerSocket));
352352
}
353353
}
354354
}

0 commit comments

Comments
 (0)