Skip to content

Commit 104f5f5

Browse files
committed
- enables all mode analysis
Signed-off-by: Vincent Biret <[email protected]>
1 parent ee526e7 commit 104f5f5

File tree

13 files changed

+81
-72
lines changed

13 files changed

+81
-72
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"titleBar.activeForeground": "#F0FCFE"
66
},
77
"cSpell.words": [
8+
"csdl",
89
"Hidi"
910
]
1011
}

src/Microsoft.OpenApi.Hidi/Formatters/PowerShellFormatter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public override void Visit(OpenApiOperation operation)
8888
private static string ResolveVerbSegmentInOpertationId(string operationId)
8989
{
9090
var charPos = operationId.LastIndexOf('.', operationId.Length - 1);
91-
if (operationId.Contains('_') || charPos < 0)
91+
if (operationId.Contains('_', StringComparison.OrdinalIgnoreCase) || charPos < 0)
9292
return operationId;
9393
var newOperationId = new StringBuilder(operationId);
9494
newOperationId[charPos] = '_';
@@ -99,7 +99,7 @@ private static string ResolveVerbSegmentInOpertationId(string operationId)
9999
private static string ResolvePutOperationId(string operationId)
100100
{
101101
return operationId.Contains(DefaultPutPrefix, StringComparison.OrdinalIgnoreCase) ?
102-
operationId.Replace(DefaultPutPrefix, PowerShellPutPrefix) : operationId;
102+
operationId.Replace(DefaultPutPrefix, PowerShellPutPrefix, StringComparison.Ordinal) : operationId;
103103
}
104104

105105
private static string ResolveByRefOperationId(string operationId)

src/Microsoft.OpenApi.Hidi/Handlers/PluginCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public async Task<int> InvokeAsync(InvocationContext context)
3131
var logger = loggerFactory.CreateLogger<PluginCommandHandler>();
3232
try
3333
{
34-
await OpenApiService.PluginManifest(hidiOptions, logger, cancellationToken);
34+
await OpenApiService.PluginManifest(hidiOptions, logger, cancellationToken).ConfigureAwait(false);
3535

3636
return 0;
3737
}

src/Microsoft.OpenApi.Hidi/Handlers/ShowCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public async Task<int> InvokeAsync(InvocationContext context)
3131
var logger = loggerFactory.CreateLogger<ShowCommandHandler>();
3232
try
3333
{
34-
await OpenApiService.ShowOpenApiDocument(hidiOptions, logger, cancellationToken);
34+
await OpenApiService.ShowOpenApiDocument(hidiOptions, logger, cancellationToken).ConfigureAwait(false);
3535

3636
return 0;
3737
}

src/Microsoft.OpenApi.Hidi/Handlers/TransformCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public async Task<int> InvokeAsync(InvocationContext context)
3131
var logger = loggerFactory.CreateLogger<TransformCommandHandler>();
3232
try
3333
{
34-
await OpenApiService.TransformOpenApiDocument(hidiOptions, logger, cancellationToken);
34+
await OpenApiService.TransformOpenApiDocument(hidiOptions, logger, cancellationToken).ConfigureAwait(false);
3535

3636
return 0;
3737
}

src/Microsoft.OpenApi.Hidi/Handlers/ValidateCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public async Task<int> InvokeAsync(InvocationContext context)
3333
try
3434
{
3535
if (hidiOptions.OpenApi is null) throw new InvalidOperationException("OpenApi file is required");
36-
await OpenApiService.ValidateOpenApiDocument(hidiOptions.OpenApi, logger, cancellationToken);
36+
await OpenApiService.ValidateOpenApiDocument(hidiOptions.OpenApi, logger, cancellationToken).ConfigureAwait(false);
3737
return 0;
3838
}
3939
catch (Exception ex)

src/Microsoft.OpenApi.Hidi/Logger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Microsoft.OpenApi.Hidi
77
{
8-
public class Logger
8+
public static class Logger
99
{
1010
public static ILoggerFactory ConfigureLogger(LogLevel logLevel)
1111
{

src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
<SignAssembly>true</SignAssembly>
2929
<!-- https://github.com/dotnet/sourcelink/blob/main/docs/README.md#embeduntrackedsources -->
3030
<EmbedUntrackedSources>true</EmbedUntrackedSources>
31-
<NoWarn>NU5048</NoWarn>
31+
<NoWarn>NU5048;CA1848;</NoWarn>
3232
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3333
<PackageReadmeFile>readme.md</PackageReadmeFile>
34+
<AnalysisMode>All</AnalysisMode>
3435
</PropertyGroup>
3536

3637
<ItemGroup>

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

Lines changed: 43 additions & 45 deletions
Large diffs are not rendered by default.

src/Microsoft.OpenApi.Hidi/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static async Task<int> Main(string[] args)
1717
var rootCommand = CreateRootCommand();
1818

1919
// Parse the incoming args and invoke the handler
20-
return await rootCommand.InvokeAsync(args);
20+
return await rootCommand.InvokeAsync(args).ConfigureAwait(false);
2121
}
2222

2323
internal static RootCommand CreateRootCommand()

0 commit comments

Comments
 (0)