nuget bump
2023-11-02 2023-11-08 net8.0 editorconfig NuGet NuSpec Kanban
This commit is contained in:
@ -71,7 +71,7 @@ internal static partial class HelperMarkdown
|
||||
|
||||
private static List<string> GetFrontMatterLines(string[] parsedLines)
|
||||
{
|
||||
List<string> results = new();
|
||||
List<string> results = [];
|
||||
string afterTrim;
|
||||
string[] segments;
|
||||
StringBuilder stringBuilder = new();
|
||||
@ -153,8 +153,8 @@ internal static partial class HelperMarkdown
|
||||
|
||||
private static List<MarkdownFileAndLines> GetMarkdownFileAndLines(string file, List<MarkdownFileAndLines> markdownFiles)
|
||||
{
|
||||
List<MarkdownFileAndLines> results = new();
|
||||
List<string> distinct = new();
|
||||
List<MarkdownFileAndLines> results = [];
|
||||
List<string> distinct = [];
|
||||
string? directory = Path.GetDirectoryName(file);
|
||||
foreach (MarkdownFileAndLines markdownFileAndLines in markdownFiles)
|
||||
{
|
||||
@ -259,12 +259,12 @@ internal static partial class HelperMarkdown
|
||||
int notCompleted;
|
||||
List<string> lines;
|
||||
string? effort = null;
|
||||
List<string> assignees = new();
|
||||
List<string> assignees = [];
|
||||
string? requestedDateTime = null;
|
||||
ReadOnlyCollection<Group> groups;
|
||||
List<H2HexColor> h2HexColors = new();
|
||||
List<H2NoCheckboxes> h2NoCheckboxes = new();
|
||||
List<H2WithCheckboxes> h2WithCheckboxes = new();
|
||||
List<H2HexColor> h2HexColors = [];
|
||||
List<H2NoCheckboxes> h2NoCheckboxes = [];
|
||||
List<H2WithCheckboxes> h2WithCheckboxes = [];
|
||||
if (markdownFileAndLines.MarkdownFile.LineNumber.FrontMatterYamlEnd is not null)
|
||||
{
|
||||
for (int i = 1; i < markdownFileAndLines.Lines.Length; i++)
|
||||
@ -300,7 +300,7 @@ internal static partial class HelperMarkdown
|
||||
h2HexColors.Add(new(line[skip..], $"#{groups.First(l => l.Value.Length == 6)}"));
|
||||
continue;
|
||||
}
|
||||
lines = new();
|
||||
lines = [];
|
||||
if (i + 1 == markdownFileAndLines.Lines.Length)
|
||||
continue;
|
||||
for (int j = i + 1; j < markdownFileAndLines.Lines.Length; j++)
|
||||
@ -335,10 +335,10 @@ internal static partial class HelperMarkdown
|
||||
|
||||
private static List<MarkdownFileAndLines> Distinct(IEnumerable<MarkdownFileAndLines>? markdownFileAndLinesCollection)
|
||||
{
|
||||
List<MarkdownFileAndLines> results = new();
|
||||
List<MarkdownFileAndLines> results = [];
|
||||
if (markdownFileAndLinesCollection is not null)
|
||||
{
|
||||
List<string> distinct = new();
|
||||
List<string> distinct = [];
|
||||
foreach (MarkdownFileAndLines markdownFileAndLines in markdownFileAndLinesCollection)
|
||||
{
|
||||
if (distinct.Contains(markdownFileAndLines.MarkdownFile.File))
|
||||
@ -352,7 +352,7 @@ internal static partial class HelperMarkdown
|
||||
|
||||
private static List<MarkdownFileAndLines> GetMarkdownFileAndLines(ReadOnlyDictionary<string, List<MarkdownFileAndLines>> keyValuePairs)
|
||||
{
|
||||
List<MarkdownFileAndLines> results = new();
|
||||
List<MarkdownFileAndLines> results = [];
|
||||
foreach (KeyValuePair<string, List<MarkdownFileAndLines>> keyValuePair in keyValuePairs)
|
||||
{
|
||||
foreach (MarkdownFileAndLines markdownFileAndLines in keyValuePair.Value)
|
||||
@ -370,7 +370,7 @@ internal static partial class HelperMarkdown
|
||||
string[] segmentsB;
|
||||
string segmentsLast;
|
||||
string segmentsFirst;
|
||||
List<string> jsonLines = new();
|
||||
List<string> jsonLines = [];
|
||||
for (int i = 0; i < frontMatterYamlEnd; i++)
|
||||
{
|
||||
if (lines[i] == "---")
|
||||
@ -430,13 +430,13 @@ internal static partial class HelperMarkdown
|
||||
if (jsonLines.Count > 0)
|
||||
(result, keyValuePairs, results) = Get(jsonLines);
|
||||
else
|
||||
(result, keyValuePairs, results) = (null, null, new());
|
||||
(result, keyValuePairs, results) = (null, null, []);
|
||||
return (result, keyValuePairs, results.ToArray());
|
||||
}
|
||||
|
||||
private static ReadOnlyDictionary<string, List<MarkdownFileAndLines>> GetKeyValuePairs(ReadOnlyDictionary<string, MarkdownFileAndLines> relativeToCollection)
|
||||
{
|
||||
Dictionary<string, List<MarkdownFileAndLines>> results = new();
|
||||
Dictionary<string, List<MarkdownFileAndLines>> results = [];
|
||||
MarkdownFile markdownFile;
|
||||
string fileNameWithoutExtension;
|
||||
string fileNameWithoutExtensionB;
|
||||
@ -446,7 +446,7 @@ internal static partial class HelperMarkdown
|
||||
markdownFile = relativeTo.Value.MarkdownFile;
|
||||
if (!results.TryGetValue(relativeTo.Key, out markdownFiles))
|
||||
{
|
||||
results.Add(relativeTo.Key, new());
|
||||
results.Add(relativeTo.Key, []);
|
||||
if (!results.TryGetValue(relativeTo.Key, out markdownFiles))
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
@ -459,7 +459,7 @@ internal static partial class HelperMarkdown
|
||||
fileNameWithoutExtensionB = fileNameWithoutExtension.Replace("%20", "-").Replace(' ', '-');
|
||||
if (!results.TryGetValue(markdownFile.FileNameWithoutExtension, out markdownFiles))
|
||||
{
|
||||
results.Add(markdownFile.FileNameWithoutExtension, new());
|
||||
results.Add(markdownFile.FileNameWithoutExtension, []);
|
||||
if (!results.TryGetValue(markdownFile.FileNameWithoutExtension, out markdownFiles))
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
@ -468,7 +468,7 @@ internal static partial class HelperMarkdown
|
||||
continue;
|
||||
if (!results.TryGetValue(fileNameWithoutExtension, out markdownFiles))
|
||||
{
|
||||
results.Add(fileNameWithoutExtension, new());
|
||||
results.Add(fileNameWithoutExtension, []);
|
||||
if (!results.TryGetValue(fileNameWithoutExtension, out markdownFiles))
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
@ -476,7 +476,7 @@ internal static partial class HelperMarkdown
|
||||
continue;
|
||||
if (!results.TryGetValue(fileNameWithoutExtensionB, out markdownFiles))
|
||||
{
|
||||
results.Add(fileNameWithoutExtensionB, new());
|
||||
results.Add(fileNameWithoutExtensionB, []);
|
||||
if (!results.TryGetValue(fileNameWithoutExtensionB, out markdownFiles))
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
@ -487,7 +487,7 @@ internal static partial class HelperMarkdown
|
||||
markdownFile = relativeTo.Value.MarkdownFile;
|
||||
if (!results.TryGetValue(markdownFile.H1, out markdownFiles))
|
||||
{
|
||||
results.Add(markdownFile.H1, new());
|
||||
results.Add(markdownFile.H1, []);
|
||||
if (!results.TryGetValue(markdownFile.H1, out markdownFiles))
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
@ -548,7 +548,7 @@ internal static partial class HelperMarkdown
|
||||
|
||||
private static ReadOnlyDictionary<string, MarkdownFileAndLines> GetRelativeToCollection(AppSettings appSettings, Input input, string[] files, bool force)
|
||||
{
|
||||
Dictionary<string, MarkdownFileAndLines> results = new();
|
||||
Dictionary<string, MarkdownFileAndLines> results = [];
|
||||
string h1;
|
||||
string key;
|
||||
string type;
|
||||
@ -571,7 +571,7 @@ internal static partial class HelperMarkdown
|
||||
else
|
||||
{
|
||||
type = appSettings.DefaultNoteType;
|
||||
File.WriteAllLines(file, new string[] { "---", $"type: \"{type}\"", "---", string.Empty, $"# {h1}" });
|
||||
File.WriteAllLines(file, ["---", $"type: \"{type}\"", "---", string.Empty, $"# {h1}"]);
|
||||
lines = File.ReadAllLines(file).ToList();
|
||||
}
|
||||
markdownFile = new(fileInfo.CreationTime,
|
||||
@ -587,23 +587,23 @@ internal static partial class HelperMarkdown
|
||||
if (force || input.StartAt is null || file.StartsWith(input.StartAt))
|
||||
results.Add(key, new(markdownFile, lines.ToArray()));
|
||||
else
|
||||
results.Add(key, new(markdownFile, Array.Empty<string>()));
|
||||
results.Add(key, new(markdownFile, []));
|
||||
}
|
||||
return new(results);
|
||||
}
|
||||
|
||||
private static ReadOnlyDictionary<string, List<Card>> GetColumnsToCards(Input input, ReadOnlyDictionary<string, MarkdownFileAndLines> relativeToCollection)
|
||||
{
|
||||
Dictionary<string, List<Card>> results = new();
|
||||
Dictionary<string, List<Card>> results = [];
|
||||
Card card;
|
||||
string key;
|
||||
string[] lines;
|
||||
string[] segmentsA;
|
||||
string? column = null;
|
||||
List<Card> cards = new();
|
||||
List<Card> cards = [];
|
||||
List<string> allKeys = [];
|
||||
MarkdownFile markdownFile;
|
||||
MarkdownExtra markdownExtra;
|
||||
List<string> allKeys = new();
|
||||
MarkdownFileAndLines? markdownFileAndLines;
|
||||
foreach (KeyValuePair<string, MarkdownFileAndLines> relativeTo in relativeToCollection)
|
||||
allKeys.Add(relativeTo.Key);
|
||||
@ -626,7 +626,7 @@ internal static partial class HelperMarkdown
|
||||
if (column is null)
|
||||
throw new NullReferenceException(nameof(column));
|
||||
results.Add(column, cards);
|
||||
cards = new();
|
||||
cards = [];
|
||||
}
|
||||
column = lines[i][3..].TrimEnd();
|
||||
if (lines.Length == i + 1)
|
||||
@ -695,7 +695,7 @@ internal static partial class HelperMarkdown
|
||||
{
|
||||
column = "Not Linked";
|
||||
results.Add(column, cards);
|
||||
cards = new();
|
||||
cards = [];
|
||||
}
|
||||
}
|
||||
return new(results);
|
||||
@ -714,7 +714,7 @@ internal static partial class HelperMarkdown
|
||||
else
|
||||
{
|
||||
List<MarkdownFileAndLines> matches;
|
||||
matches = markdownFileAndLinesCollection is null ? new() : GetMarkdownFileAndLines(file, markdownFileAndLinesCollection);
|
||||
matches = markdownFileAndLinesCollection is null ? [] : GetMarkdownFileAndLines(file, markdownFileAndLinesCollection);
|
||||
if (matches.Count == 1)
|
||||
result = matches[0];
|
||||
else
|
||||
@ -793,7 +793,7 @@ internal static partial class HelperMarkdown
|
||||
private static int ConvertFrontMatterToJsonFriendly(ReadOnlyDictionary<string, MarkdownFileAndLines> relativeToCollection)
|
||||
{
|
||||
int result = 0;
|
||||
List<string> results = new();
|
||||
List<string> results = [];
|
||||
bool write;
|
||||
string[] lines;
|
||||
MarkdownFile markdownFile;
|
||||
@ -1101,7 +1101,7 @@ internal static partial class HelperMarkdown
|
||||
|
||||
private static List<MarkdownFileAndLines> GetRecursiveLines(AppSettings appSettings, Input input, ILogger<Worker> logger, ReadOnlyDictionary<string, MarkdownFileAndLines> relativeToCollection)
|
||||
{
|
||||
List<MarkdownFileAndLines> results = new();
|
||||
List<MarkdownFileAndLines> results = [];
|
||||
string[] lines;
|
||||
List<char> indentations;
|
||||
MarkdownFile markdownFile;
|
||||
@ -1113,8 +1113,8 @@ internal static partial class HelperMarkdown
|
||||
continue;
|
||||
if (input.StartAt is null || !relativeTo.Value.MarkdownFile.File.StartsWith(input.StartAt) || Path.GetFileName(relativeTo.Value.MarkdownFile.Directory) != Path.GetFileName(input.StartAt))
|
||||
continue;
|
||||
indentations = new();
|
||||
recursiveLines = new();
|
||||
indentations = [];
|
||||
recursiveLines = [];
|
||||
lines = relativeTo.Value.Lines;
|
||||
markdownFile = relativeTo.Value.MarkdownFile;
|
||||
SetRecursiveLines(appSettings, logger, keyValuePairs, markdownFile.FileNameWithoutExtension, markdownFile, lines, indentations, recursiveLines);
|
||||
@ -1153,7 +1153,7 @@ internal static partial class HelperMarkdown
|
||||
|
||||
private static List<Record> GetWithLinksForHugo(AppSettings appSettings, Input input)
|
||||
{
|
||||
List<Record> results = new();
|
||||
List<Record> results = [];
|
||||
string file;
|
||||
string line;
|
||||
string[] lines;
|
||||
@ -1212,7 +1212,7 @@ internal static partial class HelperMarkdown
|
||||
|
||||
private static List<string> GetDistinct(List<Record> collection)
|
||||
{
|
||||
List<string> results = new();
|
||||
List<string> results = [];
|
||||
foreach (Record record in collection)
|
||||
{
|
||||
if (results.Contains(record.Directory))
|
||||
@ -1278,7 +1278,7 @@ internal static partial class HelperMarkdown
|
||||
private static int SetFrontMatterAndH1(AppSettings appSettings, ReadOnlyDictionary<string, MarkdownFileAndLines> relativeToCollection)
|
||||
{
|
||||
int result = 0;
|
||||
List<string> results = new();
|
||||
List<string> results = [];
|
||||
string h1Line;
|
||||
string[] lines;
|
||||
string typeLine;
|
||||
|
Reference in New Issue
Block a user