Rename
editorconfig
This commit is contained in:
@ -55,13 +55,13 @@ public class MirrorLength
|
||||
|
||||
private static List<(string, string, DateTime, long)[]> GetToDoCollection(ProgressBar progressBar, List<string[]> filesCollection)
|
||||
{
|
||||
List<(string, string, DateTime, long)[]> results = new();
|
||||
List<(string, string, DateTime, long)[]> results = [];
|
||||
FileInfo fileInfo;
|
||||
List<(string, string, DateTime, long)> collection;
|
||||
foreach (string[] files in filesCollection)
|
||||
{
|
||||
progressBar.Tick();
|
||||
collection = new();
|
||||
collection = [];
|
||||
foreach (string file in files)
|
||||
{
|
||||
if (file.EndsWith("len"))
|
||||
@ -71,7 +71,7 @@ public class MirrorLength
|
||||
continue;
|
||||
collection.Add((fileInfo.DirectoryName, file, fileInfo.LastWriteTime, fileInfo.Length));
|
||||
}
|
||||
if (!collection.Any())
|
||||
if (collection.Count == 0)
|
||||
continue;
|
||||
results.Add(collection.ToArray());
|
||||
}
|
||||
@ -85,7 +85,7 @@ public class MirrorLength
|
||||
ProgressBar progressBar;
|
||||
string subDirectoryName;
|
||||
string[] subDirectories;
|
||||
List<(string, string, int)> results = new();
|
||||
List<(string, string, int)> results = [];
|
||||
ProgressBarOptions options = new() { ProgressCharacter = '─', ProgressBarOnBottom = true, DisableBottomPercentage = true };
|
||||
string[] directories = Directory.GetDirectories(_PropertyConfiguration.RootDirectory, "*", SearchOption.TopDirectoryOnly);
|
||||
progressBar = new(directories.Length, message, options);
|
||||
@ -112,7 +112,7 @@ public class MirrorLength
|
||||
string checkFile;
|
||||
string checkDirectory;
|
||||
string? firstDirectory;
|
||||
List<string> directories = new();
|
||||
List<string> directories = [];
|
||||
foreach ((string Directory, string, DateTime, long)[] collection in results)
|
||||
{
|
||||
progressBar.Tick();
|
||||
@ -153,20 +153,20 @@ public class MirrorLength
|
||||
string text;
|
||||
string subKey;
|
||||
string checkFile;
|
||||
Dictionary<string, List<string>> directoryNameToCount = new();
|
||||
Dictionary<string, List<string>> subDirectoryNameToCount = new();
|
||||
Dictionary<string, List<string>> directoryNameToCount = [];
|
||||
Dictionary<string, List<string>> subDirectoryNameToCount = [];
|
||||
foreach ((string directoryName, string subDirectoryName, int count) in collection)
|
||||
{
|
||||
key = directoryName.Replace(today, string.Empty).Replace(")", "-");
|
||||
subKey = subDirectoryName.Replace(today, string.Empty).Replace(") ", "-").Replace(" ", "-");
|
||||
if (!directoryNameToCount.ContainsKey(key))
|
||||
directoryNameToCount.Add(key, new() { "---", $"title: {key}", $"desc: '{directoryName}'", "---", string.Empty });
|
||||
directoryNameToCount.Add(key, ["---", $"title: {key}", $"desc: '{directoryName}'", "---", string.Empty]);
|
||||
if (count == 0)
|
||||
directoryNameToCount[key].Add($"- <00000000> '{subDirectoryName}'");
|
||||
else
|
||||
directoryNameToCount[key].Add($"- <{count:00000000}> [[{subKey}]]");
|
||||
if (!subDirectoryNameToCount.ContainsKey(subKey))
|
||||
subDirectoryNameToCount.Add(subKey, new() { "---", $"title: {subKey}", $"desc: '{subDirectoryName}'", "---", string.Empty });
|
||||
subDirectoryNameToCount.Add(subKey, ["---", $"title: {subKey}", $"desc: '{subDirectoryName}'", "---", string.Empty]);
|
||||
if (count == 0)
|
||||
subDirectoryNameToCount[subKey].Add($"- <00000000> '{directoryName}'");
|
||||
else
|
||||
@ -194,15 +194,15 @@ public class MirrorLength
|
||||
List<(string, string, int)> collectionForMarkDown;
|
||||
bool inPlaceSave = _PropertyConfiguration.RootDirectory.First() == _AppSettings.Destination;
|
||||
if (!inPlaceSave)
|
||||
collectionForMarkDown = new();
|
||||
collectionForMarkDown = [];
|
||||
else
|
||||
{
|
||||
string today = DateTime.Now.ToString("yyyy-MM-dd-");
|
||||
collectionForMarkDown = GetToDoCollectionForMarkDown(message, today);
|
||||
if (collectionForMarkDown.Any())
|
||||
if (collectionForMarkDown.Count != 0)
|
||||
Write(today, collectionForMarkDown);
|
||||
}
|
||||
if (!collectionForMarkDown.Any())
|
||||
if (collectionForMarkDown.Count == 0)
|
||||
{
|
||||
ProgressBar progressBar;
|
||||
const bool useCeilingAverage = true;
|
||||
@ -214,7 +214,7 @@ public class MirrorLength
|
||||
List<(string, string, DateTime, long)[]> collection = GetToDoCollection(progressBar, filesCollection);
|
||||
progressBar.Dispose();
|
||||
progressBar = new(filesCollection.Count, message, options);
|
||||
if (collection.Any())
|
||||
if (collection.Count != 0)
|
||||
Write(ticks, inPlaceSave, progressBar, collection);
|
||||
progressBar.Dispose();
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class Program
|
||||
if (args is not null)
|
||||
Secondary(logger, args.ToList());
|
||||
else
|
||||
Secondary(logger, new List<string>());
|
||||
Secondary(logger, []);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user