Code formatting updates (#4502)

* Editorconfig: Add space_before_self_closing setting

This was a difference between the way dotnet-format and Rider format code. See https://www.jetbrains.com/help/rider/EditorConfig_Index.html

* Editorconfig: Keep 4 spaces indentation for Swagger JSON files

They are all formatted that way, let's keep it like that.

* Apply dotnet-format, mostly white-space related changes
This commit is contained in:
d11n
2023-01-06 14:18:07 +01:00
committed by GitHub
parent 3fa28bb46d
commit d5d0be5824
241 changed files with 1815 additions and 1715 deletions

View File

@@ -186,7 +186,7 @@ namespace BTCPayServer.Controllers
[HttpPost("{storeId}/users/{userId}/delete")]
public async Task<IActionResult> DeleteStoreUserPost(string storeId, string userId)
{
if(await _Repo.RemoveStoreUser(storeId, userId))
if (await _Repo.RemoveStoreUser(storeId, userId))
TempData[WellKnownTempData.SuccessMessage] = "User removed successfully.";
else
{
@@ -409,7 +409,7 @@ namespace BTCPayServer.Controllers
public PaymentMethodOptionViewModel.Format[] GetEnabledPaymentMethodChoices(StoreData storeData)
{
var enabled = storeData.GetEnabledPaymentIds(_NetworkProvider);
return enabled
.Select(o =>
new PaymentMethodOptionViewModel.Format()
@@ -646,11 +646,11 @@ namespace BTCPayServer.Controllers
return View(model);
}
blob.BrandColor = model.BrandColor;
var userId = GetUserId();
if (userId is null)
return NotFound();
if (model.LogoFile != null)
{
if (model.LogoFile.ContentType.StartsWith("image/", StringComparison.InvariantCulture))
@@ -660,7 +660,7 @@ namespace BTCPayServer.Controllers
{
await _fileService.RemoveFile(blob.LogoFileId, userId);
}
// add new image
try
{
@@ -683,7 +683,7 @@ namespace BTCPayServer.Controllers
blob.LogoFileId = null;
needUpdate = true;
}
if (CurrentStore.SetStoreBlob(blob))
{
needUpdate = true;
@@ -743,7 +743,7 @@ namespace BTCPayServer.Controllers
}).ToArray() ?? new AccountKeySettings[result.Item1.GetExtPubKeys().Count()];
return derivationSchemeSettings;
}
var strategy = parser.Parse(derivationScheme);
return new DerivationSchemeSettings(strategy, network);
}
@@ -915,10 +915,10 @@ namespace BTCPayServer.Controllers
var userId = GetUserId();
if (userId == null)
return Challenge(AuthenticationSchemes.Cookie);
if (pairingCode == null)
return NotFound();
if (selectedStore != null)
{
var store = await _Repo.FindStore(selectedStore, userId);
@@ -926,14 +926,14 @@ namespace BTCPayServer.Controllers
return NotFound();
HttpContext.SetStoreData(store);
}
var pairing = await _TokenRepository.GetPairingAsync(pairingCode);
if (pairing == null)
{
TempData[WellKnownTempData.ErrorMessage] = "Unknown pairing code";
return RedirectToAction(nameof(UIHomeController.Index), "UIHome");
}
var stores = await _Repo.GetStoresByUserId(userId);
return View(new PairingModel
{