Skip to content

Commit

Permalink
style: format code with dotnet-format
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in bdccb4a according to the output
from dotnet-format.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Jan 7, 2024
1 parent bdccb4a commit 452751f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/Configuration/JsonFileConfigurationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ internal static Stream MakeKeyPerJsonFileInputStream(this FileInfo jsonFile, ILo
json = $$$"""
{
"{{{Path.GetFileNameWithoutExtension(jsonFile.FullName)}}}":
{{{json}}}
{ { { json} } }
}
""";
return new MemoryStream(json.ToUTF8Bytes());
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Services/HttpServicesExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ public static IHostApplicationBuilder AddHttpServices(
);
}

if(options.IIS != null)
if (options.IIS != null)
{
builder.Services.Configure<IISServerOptions>(
options =>
builder.Configuration.Bind($"{configurationSectionKey}:{IIS}", options)
);
}

if(options.Kestrel != null)
if (options.Kestrel != null)
{
builder.Services.Configure<KestrelServerOptions>(
options =>
Expand Down
24 changes: 12 additions & 12 deletions src/Http/Services/UseHttpServicesExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static IApplicationBuilder UseHttpServices(this IApplicationBuilder app)
{
var options = app.ApplicationServices.GetRequiredService<IOptions<HttpServicesOptions>>().Value;

if(options.UseRequestDecompression)
if (options.UseRequestDecompression)
{
app.UseRequestDecompression();
}
Expand All @@ -21,37 +21,37 @@ public static IApplicationBuilder UseHttpServices(this IApplicationBuilder app)
app.UseResponseCompression();
}

if(options.UseFileServer)
if (options.UseFileServer)
{
app.UseFileServer(options.FileServer);

if(options.FileServer.EnableDefaultFiles)
if (options.FileServer.EnableDefaultFiles)
{
app.UseDefaultFiles(options.FileServer.DefaultFilesOptions);
}

if(options.FileServer.EnableDirectoryBrowsing)
if (options.FileServer.EnableDirectoryBrowsing)
{
app.UseDirectoryBrowser(options.FileServer.DirectoryBrowserOptions);
}

if(options.FileServer.StaticFileOptions != null)
if (options.FileServer.StaticFileOptions != null)
{
app.UseStaticFiles(options.FileServer.StaticFileOptions);
}
}

if(options.UseResponseCaching)
if (options.UseResponseCaching)
{
app.UseResponseCaching();
}

if(options.UseForwardedHeaders)
if (options.UseForwardedHeaders)
{
app.UseForwardedHeaders(options.ForwardedHeaders);
}

if(options.UseCors)
if (options.UseCors)
{
app.UseCors();
// _ = app.UseCors(corsOptions => corsOptions
Expand All @@ -63,22 +63,22 @@ public static IApplicationBuilder UseHttpServices(this IApplicationBuilder app)
// );
}

if(options.UseCookiePolicy)
if (options.UseCookiePolicy)
{
app.UseCookiePolicy(options.CookiePolicy);
}

if(options.UseSession)
if (options.UseSession)
{
app.UseSession(options.Session);
}

if(options.UseHsts)
if (options.UseHsts)
{
app.UseHsts();
}

if(options.UseHttpsRedirection)
if (options.UseHttpsRedirection)
{
app.UseHttpsRedirection();
}
Expand Down
12 changes: 6 additions & 6 deletions src/Mvc/IHostApplicationBuilderMvcExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static IHostApplicationBuilder AddMvc(this IHostApplicationBuilder builde
builder.Services.Configure<MvcOptions>(mvcOptionsSection);
var mvcOptions = mvcOptionsSection.Get<MvcOptions>();

if(mvcOptions is not null)
if (mvcOptions is not null)
{
#if NET5_0_OR_GREATER
if(mvcOptions.EnableEndpointRouting)
Expand All @@ -44,27 +44,27 @@ public static IHostApplicationBuilder AddMvc(this IHostApplicationBuilder builde
}
#endif

if(mvcOptions.AddControllersAsServices)
if (mvcOptions.AddControllersAsServices)
{
mvcBuilder.AddControllersAsServices();
}

if(mvcOptions.AddXmlSerializerFormatters)
if (mvcOptions.AddXmlSerializerFormatters)
{
mvcBuilder.AddXmlSerializerFormatters();
}

if(mvcOptions.AddXmlDataContractSerializerFormatters)
if (mvcOptions.AddXmlDataContractSerializerFormatters)
{
mvcBuilder.AddXmlDataContractSerializerFormatters();
}

if(mvcOptions.AddJsonOptions)
if (mvcOptions.AddJsonOptions)
{
mvcBuilder.AddJsonOptions(options => builder.Configuration.Bind(JsonSerializer, options));
}

if(mvcOptions.AddMvcConventions)
if (mvcOptions.AddMvcConventions)
{
// mvcBuilder.AddMvcOptions(options => builder.Configuration.Bind(configurationSectionKey, options));
}
Expand Down

0 comments on commit 452751f

Please sign in to comment.