Fix style violations

pull/515/head
Pavel Djundik 1 year ago
parent 9d04652f60
commit 65c07130a1

@ -95,7 +95,6 @@ dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_s
dotnet_naming_symbols.instance_fields.applicable_kinds = field dotnet_naming_symbols.instance_fields.applicable_kinds = field
dotnet_naming_style.instance_field_style.capitalization = camel_case dotnet_naming_style.instance_field_style.capitalization = camel_case
dotnet_naming_style.instance_field_style.required_prefix = _
# Locals and parameters are camelCase # Locals and parameters are camelCase
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
@ -124,20 +123,6 @@ dotnet_naming_symbols.all_members.applicable_kinds = *
dotnet_naming_style.pascal_case_style.capitalization = pascal_case dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Async methods should have "Async" suffix
dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods
dotnet_naming_rule.async_methods_end_in_async.style = end_in_async
dotnet_naming_rule.async_methods_end_in_async.severity = warning
dotnet_naming_symbols.any_async_methods.applicable_kinds = method
dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
dotnet_naming_symbols.any_async_methods.required_modifiers = async
dotnet_naming_style.end_in_async.required_prefix =
dotnet_naming_style.end_in_async.required_suffix = Async
dotnet_naming_style.end_in_async.capitalization = pascal_case
dotnet_naming_style.end_in_async.word_separator =
# error RS2008: Enable analyzer release tracking for the analyzer project containing rule '{0}' # error RS2008: Enable analyzer release tracking for the analyzer project containing rule '{0}'
dotnet_diagnostic.RS2008.severity = none dotnet_diagnostic.RS2008.severity = none

@ -110,7 +110,7 @@ namespace DepotDownloader
IEnumerable<uint> licenseQuery; IEnumerable<uint> licenseQuery;
if (steam3.steamUser.SteamID.AccountType == EAccountType.AnonUser) if (steam3.steamUser.SteamID.AccountType == EAccountType.AnonUser)
{ {
licenseQuery = new List<uint> { 17906 }; licenseQuery = [17906];
} }
else else
{ {
@ -610,16 +610,16 @@ namespace DepotDownloader
private class GlobalDownloadCounter private class GlobalDownloadCounter
{ {
public ulong TotalBytesCompressed; public ulong totalBytesCompressed;
public ulong TotalBytesUncompressed; public ulong totalBytesUncompressed;
} }
private class DepotDownloadCounter private class DepotDownloadCounter
{ {
public ulong CompleteDownloadSize; public ulong completeDownloadSize;
public ulong SizeDownloaded; public ulong sizeDownloaded;
public ulong DepotBytesCompressed; public ulong depotBytesCompressed;
public ulong DepotBytesUncompressed; public ulong depotBytesUncompressed;
} }
private static async Task DownloadSteam3Async(List<DepotDownloadInfo> depots) private static async Task DownloadSteam3Async(List<DepotDownloadInfo> depots)
@ -666,7 +666,7 @@ namespace DepotDownloader
} }
Console.WriteLine("Total downloaded: {0} bytes ({1} bytes uncompressed) from {2} depots", Console.WriteLine("Total downloaded: {0} bytes ({1} bytes uncompressed) from {2} depots",
downloadCounter.TotalBytesCompressed, downloadCounter.TotalBytesUncompressed, depots.Count); downloadCounter.totalBytesCompressed, downloadCounter.totalBytesUncompressed, depots.Count);
} }
private static async Task<DepotFilesData> ProcessDepotManifestAndFiles(CancellationTokenSource cts, DepotDownloadInfo depot) private static async Task<DepotFilesData> ProcessDepotManifestAndFiles(CancellationTokenSource cts, DepotDownloadInfo depot)
@ -889,7 +889,7 @@ namespace DepotDownloader
Directory.CreateDirectory(Path.GetDirectoryName(fileFinalPath)); Directory.CreateDirectory(Path.GetDirectoryName(fileFinalPath));
Directory.CreateDirectory(Path.GetDirectoryName(fileStagingPath)); Directory.CreateDirectory(Path.GetDirectoryName(fileStagingPath));
depotCounter.CompleteDownloadSize += file.TotalSize; depotCounter.completeDownloadSize += file.TotalSize;
} }
}); });
@ -961,7 +961,7 @@ namespace DepotDownloader
DepotConfigStore.Instance.InstalledManifestIDs[depot.DepotId] = depot.ManifestId; DepotConfigStore.Instance.InstalledManifestIDs[depot.DepotId] = depot.ManifestId;
DepotConfigStore.Save(); DepotConfigStore.Save();
Console.WriteLine("Depot {0} - Downloaded {1} bytes ({2} bytes uncompressed)", depot.DepotId, depotCounter.DepotBytesCompressed, depotCounter.DepotBytesUncompressed); Console.WriteLine("Depot {0} - Downloaded {1} bytes ({2} bytes uncompressed)", depot.DepotId, depotCounter.depotBytesCompressed, depotCounter.depotBytesUncompressed);
} }
private static void DownloadSteam3AsyncDepotFile( private static void DownloadSteam3AsyncDepotFile(
@ -1124,8 +1124,8 @@ namespace DepotDownloader
{ {
lock (depotDownloadCounter) lock (depotDownloadCounter)
{ {
depotDownloadCounter.SizeDownloaded += file.TotalSize; depotDownloadCounter.sizeDownloaded += file.TotalSize;
Console.WriteLine("{0,6:#00.00}% {1}", (depotDownloadCounter.SizeDownloaded / (float)depotDownloadCounter.CompleteDownloadSize) * 100.0f, fileFinalPath); Console.WriteLine("{0,6:#00.00}% {1}", (depotDownloadCounter.sizeDownloaded / (float)depotDownloadCounter.completeDownloadSize) * 100.0f, fileFinalPath);
} }
return; return;
@ -1134,7 +1134,7 @@ namespace DepotDownloader
var sizeOnDisk = (file.TotalSize - (ulong)neededChunks.Select(x => (long)x.UncompressedLength).Sum()); var sizeOnDisk = (file.TotalSize - (ulong)neededChunks.Select(x => (long)x.UncompressedLength).Sum());
lock (depotDownloadCounter) lock (depotDownloadCounter)
{ {
depotDownloadCounter.SizeDownloaded += sizeOnDisk; depotDownloadCounter.sizeDownloaded += sizeOnDisk;
} }
} }
@ -1271,22 +1271,22 @@ namespace DepotDownloader
ulong sizeDownloaded = 0; ulong sizeDownloaded = 0;
lock (depotDownloadCounter) lock (depotDownloadCounter)
{ {
sizeDownloaded = depotDownloadCounter.SizeDownloaded + (ulong)chunkData.Data.Length; sizeDownloaded = depotDownloadCounter.sizeDownloaded + (ulong)chunkData.Data.Length;
depotDownloadCounter.SizeDownloaded = sizeDownloaded; depotDownloadCounter.sizeDownloaded = sizeDownloaded;
depotDownloadCounter.DepotBytesCompressed += chunk.CompressedLength; depotDownloadCounter.depotBytesCompressed += chunk.CompressedLength;
depotDownloadCounter.DepotBytesUncompressed += chunk.UncompressedLength; depotDownloadCounter.depotBytesUncompressed += chunk.UncompressedLength;
} }
lock (downloadCounter) lock (downloadCounter)
{ {
downloadCounter.TotalBytesCompressed += chunk.CompressedLength; downloadCounter.totalBytesCompressed += chunk.CompressedLength;
downloadCounter.TotalBytesUncompressed += chunk.UncompressedLength; downloadCounter.totalBytesUncompressed += chunk.UncompressedLength;
} }
if (remainingChunks == 0) if (remainingChunks == 0)
{ {
var fileFinalPath = Path.Combine(depot.InstallDir, file.FileName); var fileFinalPath = Path.Combine(depot.InstallDir, file.FileName);
Console.WriteLine("{0,6:#00.00}% {1}", (sizeDownloaded / (float)depotDownloadCounter.CompleteDownloadSize) * 100.0f, fileFinalPath); Console.WriteLine("{0,6:#00.00}% {1}", (sizeDownloaded / (float)depotDownloadCounter.completeDownloadSize) * 100.0f, fileFinalPath);
} }
} }

Loading…
Cancel
Save