Skip to content

Free, open-source Windows optimization tool for performance, privacy, and simplicity.

refactor: Formatted 178 files in 2269ms.

fatDuck402e4f29095e
diff --git a/optimizerDuck/App.xaml.cs b/optimizerDuck/App.xaml.cs
index 9bc547d..73796d4 100644
--- a/optimizerDuck/App.xaml.cs
+++ b/optimizerDuck/App.xaml.cs
@@ -170,7 +170,6 @@ public partial class App : Application
}
}
-
private static async Task HandleStartupErrorStaticAsync(Exception ex)
{
LogExceptionToFile("App.Startup", ex);
diff --git a/optimizerDuck/Common/Helpers/GitHubSourceHelper.cs b/optimizerDuck/Common/Helpers/GitHubSourceHelper.cs
index 007285e..5eef08f 100644
--- a/optimizerDuck/Common/Helpers/GitHubSourceHelper.cs
+++ b/optimizerDuck/Common/Helpers/GitHubSourceHelper.cs
@@ -15,7 +15,9 @@ namespace optimizerDuck.Common.Helpers;
/// </summary>
public static class GitHubSourceHelper
{
- private static readonly HttpClient HttpClient = HttpClientFactory.CreateClient(timeout: TimeSpan.FromSeconds(5));
+ private static readonly HttpClient HttpClient = HttpClientFactory.CreateClient(
+ timeout: TimeSpan.FromSeconds(5)
+ );
private static readonly ConcurrentDictionary<
string,
Lazy<Task<(string Content, DateTime FetchedAt)>>
diff --git a/optimizerDuck/Common/Helpers/HttpClientFactory.cs b/optimizerDuck/Common/Helpers/HttpClientFactory.cs
index 7d01b64..dfa7043 100644
--- a/optimizerDuck/Common/Helpers/HttpClientFactory.cs
+++ b/optimizerDuck/Common/Helpers/HttpClientFactory.cs
@@ -32,10 +32,11 @@ public static class HttpClientFactory
if (errors == SslPolicyErrors.None)
return true;
- var certInfo = certificate != null
- ? $"Subject: {certificate.Subject}, Issuer: {certificate.Issuer}, "
- + $"Expires: {certificate.GetExpirationDateString()}"
- : "No certificate presented";
+ var certInfo =
+ certificate != null
+ ? $"Subject: {certificate.Subject}, Issuer: {certificate.Issuer}, "
+ + $"Expires: {certificate.GetExpirationDateString()}"
+ : "No certificate presented";
var remoteEndpoint = GetRemoteEndpoint(sender);
@@ -59,8 +60,8 @@ public static class HttpClientFactory
}
return false;
- }
- }
+ },
+ },
};
var client = new HttpClient(handler, disposeHandler: true);
diff --git a/optimizerDuck/Domain/Optimizations/Models/BaseOptimization.cs b/optimizerDuck/Domain/Optimizations/Models/BaseOptimization.cs
index 8ae928d..00dd31c 100644
--- a/optimizerDuck/Domain/Optimizations/Models/BaseOptimization.cs
+++ b/optimizerDuck/Domain/Optimizations/Models/BaseOptimization.cs
@@ -10,7 +10,6 @@ using OptimizationState = optimizerDuck.Domain.UI.OptimizationState;
namespace optimizerDuck.Domain.Optimizations.Models;
-
/// <summary>
/// Base class for all optimizations. Subclasses implement <see cref="ApplyAsync"/> and are
/// decorated with <see cref="OptimizationAttribute"/> to provide metadata. The category
diff --git a/optimizerDuck/Services/Configuration/ConfigManager.cs b/optimizerDuck/Services/Configuration/ConfigManager.cs
index 6ec1f66..96bd9b1 100644
--- a/optimizerDuck/Services/Configuration/ConfigManager.cs
+++ b/optimizerDuck/Services/Configuration/ConfigManager.cs
@@ -297,10 +297,7 @@ public class ConfigManager(IConfiguration configuration, ILogger<ConfigManager>
}
var propertyCount = config.Properties().Count();
- logger.LogInformation(
- "Loaded config with {Count} top-level sections",
- propertyCount
- );
+ logger.LogInformation("Loaded config with {Count} top-level sections", propertyCount);
return config;
}
catch (Exception ex)
diff --git a/optimizerDuck/Services/Customize/CustomizeRegistry.cs b/optimizerDuck/Services/Customize/CustomizeRegistry.cs
index ec91272..d87a3f9 100644
--- a/optimizerDuck/Services/Customize/CustomizeRegistry.cs
+++ b/optimizerDuck/Services/Customize/CustomizeRegistry.cs
@@ -48,7 +48,9 @@ public class CustomizeRegistry
.Select(t =>
{
var featureTypes = t.GetNestedTypes(BindingFlags.Public)
- .Where(nt => typeof(ICustomizeSetting).IsAssignableFrom(nt) && !nt.IsAbstract)
+ .Where(nt =>
+ typeof(ICustomizeSetting).IsAssignableFrom(nt) && !nt.IsAbstract
+ )
.Select(nt =>
{
var opt = (ICustomizeSetting)Activator.CreateInstance(nt)!;
diff --git a/optimizerDuck/Services/Revert/RevertManager.cs b/optimizerDuck/Services/Revert/RevertManager.cs
index 856811d..02b14a5 100644
--- a/optimizerDuck/Services/Revert/RevertManager.cs
+++ b/optimizerDuck/Services/Revert/RevertManager.cs
@@ -289,7 +289,9 @@ public class RevertManager(ILogger<RevertManager> _logger, ILoggerFactory _logge
{
TraceCorruptRevertFile(
path,
- new InvalidOperationException("Revert file path outside expected directory")
+ new InvalidOperationException(
+ "Revert file path outside expected directory"
+ )
);
return null;
}
diff --git a/optimizerDuck/Services/System/SystemInfoService.cs b/optimizerDuck/Services/System/SystemInfoService.cs
index e0a38a8..45f1e78 100644
--- a/optimizerDuck/Services/System/SystemInfoService.cs
+++ b/optimizerDuck/Services/System/SystemInfoService.cs
@@ -711,10 +711,7 @@ internal static class NativeMemory
internal static class CpuProvider
{
- private static readonly Lazy<CpuInfo> _cached = new(
- Load,
- LazyThreadSafetyMode.PublicationOnly
- );
+ private static readonly Lazy<CpuInfo> _cached = new(Load, LazyThreadSafetyMode.PublicationOnly);
/// <summary>
/// Gets CPU info using Registry (fast) + targeted WMI (only for cache sizes).
@@ -862,8 +859,7 @@ internal static class RamProvider
try
{
var capacityBytes = WmiHelper.GetLong(mem, "Capacity");
- var capacityGB =
- capacityBytes > 0 ? capacityBytes / (1024.0 * 1024.0 * 1024.0) : 0;
+ var capacityGB = capacityBytes > 0 ? capacityBytes / (1024.0 * 1024.0 * 1024.0) : 0;
var speed = WmiHelper.GetString(mem, "Speed");
var manufacturer = WmiHelper.GetString(mem, "Manufacturer");
var partNumber = WmiHelper.GetString(mem, "PartNumber");
@@ -1082,7 +1078,8 @@ public static class DiskHelper
{
try
{
- var mediaType = WmiHelper.GetString(disk, "MediaType", "")
+ var mediaType = WmiHelper
+ .GetString(disk, "MediaType", "")
.ToLowerInvariant();
var model = WmiHelper.GetString(disk, "Model", "").ToLowerInvariant();
@@ -1484,7 +1481,7 @@ internal static class DxgiHelper
[DllImport("dxgi.dll", PreserveSig = false)]
private static extern void CreateDXGIFactory1(
[In] ref Guid riid,
- [Out][MarshalAs(UnmanagedType.Interface)] out IDXGIFactory1 factory
+ [Out] [MarshalAs(UnmanagedType.Interface)] out IDXGIFactory1 factory
);
public static IDXGIFactory1 CreateFactory()
@@ -1713,8 +1710,7 @@ internal static class GpuProvider
new GpuInfo
{
Name = name,
- DriverVersion =
- wmiMatch?.DriverVersion ?? Translations.Common_Unknown,
+ DriverVersion = wmiMatch?.DriverVersion ?? Translations.Common_Unknown,
Vendor = vendor,
MemoryMB = memoryMB > 0 ? memoryMB : null,
DeviceId = wmiMatch?.DeviceId,
diff --git a/optimizerDuck/Services/UI/BloatwareService.cs b/optimizerDuck/Services/UI/BloatwareService.cs
index d68b640..8cb7779 100644
--- a/optimizerDuck/Services/UI/BloatwareService.cs
+++ b/optimizerDuck/Services/UI/BloatwareService.cs
@@ -132,10 +132,7 @@ public class BloatwareService(
/// </summary>
private static string EscapeForPowerShell(string value)
{
- return value
- .Replace("`", "``")
- .Replace("$", "`$")
- .Replace("\"", "`\"");
+ return value.Replace("`", "``").Replace("$", "`$").Replace("\"", "`\"");
}
/// <summary>
diff --git a/optimizerDuck/UI/ViewModels/Pages/CustomizeViewModel.cs b/optimizerDuck/UI/ViewModels/Pages/CustomizeViewModel.cs
index dd50620..12cee43 100644
--- a/optimizerDuck/UI/ViewModels/Pages/CustomizeViewModel.cs
+++ b/optimizerDuck/UI/ViewModels/Pages/CustomizeViewModel.cs
@@ -26,7 +26,6 @@ public partial class CustomizeViewModel : ViewModel
_registry = registry;
}
-
protected override async Task InitializeOnceAsync()
{
IsLoading = true;
diff --git a/optimizerDuck/UI/ViewModels/Pages/DiskCleanupViewModel.cs b/optimizerDuck/UI/ViewModels/Pages/DiskCleanupViewModel.cs
index bf642b2..768a05a 100644
--- a/optimizerDuck/UI/ViewModels/Pages/DiskCleanupViewModel.cs
+++ b/optimizerDuck/UI/ViewModels/Pages/DiskCleanupViewModel.cs
@@ -52,7 +52,8 @@ public partial class DiskCleanupViewModel(
public bool CanClean =>
SelectedCount > 0 && TotalSelectedSizeBytes > 0 && !IsCleaning && !IsScanning;
public bool IsAllSelected =>
- CleanupItems.Count > 0 && CleanupItems.All(i => !i.IsScanned || i.SizeBytes == 0 || i.IsSelected);
+ CleanupItems.Count > 0
+ && CleanupItems.All(i => !i.IsScanned || i.SizeBytes == 0 || i.IsSelected);
partial void OnSelectedSortByIndexChanged(int value)
{
@@ -200,12 +201,21 @@ public partial class DiskCleanupViewModel(
TotalSelectedFileCount
);
- var dialogViewModel = new DiskCleanupConfirmationDialogViewModel(selectedItems, summaryText);
+ var dialogViewModel = new DiskCleanupConfirmationDialogViewModel(
+ selectedItems,
+ summaryText
+ );
var dialog = new ContentDialog
{
- Title = string.Format(Translations.DiskCleanup_Dialog_Confirmation_Title, SelectedCount),
+ Title = string.Format(
+ Translations.DiskCleanup_Dialog_Confirmation_Title,
+ SelectedCount
+ ),
Content = new DiskCleanupConfirmationDialog { DataContext = dialogViewModel },
- PrimaryButtonText = string.Format(Translations.DiskCleanup_Button_CleanSelected, TotalSelectedSizeFormatted),
+ PrimaryButtonText = string.Format(
+ Translations.DiskCleanup_Button_CleanSelected,
+ TotalSelectedSizeFormatted
+ ),
CloseButtonText = Translations.Common_Cancel,
};