diff --git a/examples/CopyFiles/CopyFiles.csproj b/examples/CopyFiles/CopyFiles.csproj index 9f96426..8e1ea21 100644 --- a/examples/CopyFiles/CopyFiles.csproj +++ b/examples/CopyFiles/CopyFiles.csproj @@ -7,20 +7,20 @@ - - - + + + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/examples/CopyFiles/CopyFilesPipeline.cs b/examples/CopyFiles/CopyFilesPipeline.cs index 57b7e67..3e48edf 100644 --- a/examples/CopyFiles/CopyFilesPipeline.cs +++ b/examples/CopyFiles/CopyFilesPipeline.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; using MfGames.Gallium; - using MfGames.Nitride; using MfGames.Nitride.IO.Contents; using MfGames.Nitride.IO.Directories; diff --git a/examples/CopyFiles/CopyFilesProgram.cs b/examples/CopyFiles/CopyFilesProgram.cs index ada8a92..59a968f 100644 --- a/examples/CopyFiles/CopyFilesProgram.cs +++ b/examples/CopyFiles/CopyFilesProgram.cs @@ -4,7 +4,6 @@ using System.Threading.Tasks; using Autofac; using MfGames.IO.Extensions; - using MfGames.Nitride; using MfGames.Nitride.IO; @@ -27,7 +26,8 @@ public static class CopyFilesProgram // system. At the moment, we set the "root" directory which will // contains all the paths, both input and output. DirectoryInfo rootDir = - typeof(CopyFilesProgram).GetDirectory()!.FindGitRoot()!.GetDirectory("examples/CopyFiles"); + typeof(CopyFilesProgram).GetDirectory()!.FindGitRoot()! + .GetDirectory("examples/CopyFiles"); builder.WithRootDirectory(rootDir); diff --git a/examples/CopyFiles/CopyFilesTest.cs b/examples/CopyFiles/CopyFilesTest.cs index 876703b..41596a8 100644 --- a/examples/CopyFiles/CopyFilesTest.cs +++ b/examples/CopyFiles/CopyFilesTest.cs @@ -4,7 +4,6 @@ using System.Threading.Tasks; using CliWrap; using MfGames.IO.Extensions; - using MfGames.Nitride.Tests; using Xunit; @@ -27,7 +26,8 @@ public class CopyFilesTest : NitrideTestBase { // Figure out the paths for this test. DirectoryInfo rootDir = - typeof(CopyFilesProgram).GetDirectory()!.FindGitRoot()!.GetDirectory("examples/CopyFiles"); + typeof(CopyFilesProgram).GetDirectory()!.FindGitRoot()! + .GetDirectory("examples/CopyFiles"); DirectoryInfo outputDir = rootDir.GetDirectory("output"); FileInfo projectFile = rootDir.GetFile("CopyFiles.csproj"); diff --git a/src/MfGames.Nitride.Calendar/CreateCalender.cs b/src/MfGames.Nitride.Calendar/CreateCalender.cs index 6c37e15..2965c02 100644 --- a/src/MfGames.Nitride.Calendar/CreateCalender.cs +++ b/src/MfGames.Nitride.Calendar/CreateCalender.cs @@ -4,12 +4,11 @@ using System.Linq; using FluentValidation; -using MfGames.Gallium; - using Ical.Net.CalendarComponents; using Ical.Net.DataTypes; using Ical.Net.Serialization; +using MfGames.Gallium; using MfGames.Nitride.Contents; using MfGames.Nitride.Temporal; @@ -62,12 +61,14 @@ public partial class CreateCalender : OperationBase this.validator.ValidateAndThrow(this); SplitEntityEnumerations split = input.SplitEntity(); - IEnumerable datedAndCalendars = this.CreateCalendarEntity(split.HasAll); + IEnumerable datedAndCalendars = + this.CreateCalendarEntity(split.HasAll); return datedAndCalendars.Union(split.NotHasAll); } - private IEnumerable CreateCalendarEntity(IEnumerable entities) + private IEnumerable CreateCalendarEntity( + IEnumerable entities) { // Create the calendar in the same time zone as the rest of the system. var calendar = new Ical.Net.Calendar(); @@ -76,7 +77,8 @@ public partial class CreateCalender : OperationBase // Go through the events and add all of them. var input = entities.ToList(); - IEnumerable events = input.Select(this.CreateCalendarEvent); + IEnumerable events = + input.Select(this.CreateCalendarEvent); calendar.Events.AddRange(events); diff --git a/src/MfGames.Nitride.Calendar/MfGames.Nitride.Calendar.csproj b/src/MfGames.Nitride.Calendar/MfGames.Nitride.Calendar.csproj index 4d6770d..12b4ffe 100644 --- a/src/MfGames.Nitride.Calendar/MfGames.Nitride.Calendar.csproj +++ b/src/MfGames.Nitride.Calendar/MfGames.Nitride.Calendar.csproj @@ -10,16 +10,16 @@ - - - + + + - - - - + + + + diff --git a/src/MfGames.Nitride.Calendar/NitrideCalendarBuilderExtensions.cs b/src/MfGames.Nitride.Calendar/NitrideCalendarBuilderExtensions.cs index f42a0cf..7965ab2 100644 --- a/src/MfGames.Nitride.Calendar/NitrideCalendarBuilderExtensions.cs +++ b/src/MfGames.Nitride.Calendar/NitrideCalendarBuilderExtensions.cs @@ -8,7 +8,8 @@ public static class NitrideCalendarBuilderExtensions { public static NitrideBuilder UseCalendar(this NitrideBuilder builder) { - return builder.UseTemporal() + return builder + .UseTemporal() .ConfigureContainer(x => x.RegisterModule()); } } diff --git a/src/MfGames.Nitride.Feeds/CreateAtomFeed.cs b/src/MfGames.Nitride.Feeds/CreateAtomFeed.cs index c4467de..2ff32c9 100644 --- a/src/MfGames.Nitride.Feeds/CreateAtomFeed.cs +++ b/src/MfGames.Nitride.Feeds/CreateAtomFeed.cs @@ -5,7 +5,6 @@ using System.Linq; using FluentValidation; using MfGames.Gallium; - using MfGames.Nitride.Contents; using MfGames.Nitride.Feeds.Structure; diff --git a/src/MfGames.Nitride.Feeds/MfGames.Nitride.Feeds.csproj b/src/MfGames.Nitride.Feeds/MfGames.Nitride.Feeds.csproj index 94724e6..2e76f41 100644 --- a/src/MfGames.Nitride.Feeds/MfGames.Nitride.Feeds.csproj +++ b/src/MfGames.Nitride.Feeds/MfGames.Nitride.Feeds.csproj @@ -10,15 +10,15 @@ - - - + + + - - - + + + diff --git a/src/MfGames.Nitride.Feeds/Structure/AtomAuthor.cs b/src/MfGames.Nitride.Feeds/Structure/AtomAuthor.cs index bf6b559..2504223 100644 --- a/src/MfGames.Nitride.Feeds/Structure/AtomAuthor.cs +++ b/src/MfGames.Nitride.Feeds/Structure/AtomAuthor.cs @@ -29,7 +29,10 @@ public partial class AtomAuthor if (!string.IsNullOrEmpty(this.Name)) { - author.Add(new XElement(XmlConstants.AtomNamespace + "name", new XText(this.Name))); + author.Add( + new XElement( + XmlConstants.AtomNamespace + "name", + new XText(this.Name))); } return author; diff --git a/src/MfGames.Nitride.Feeds/Structure/AtomCategory.cs b/src/MfGames.Nitride.Feeds/Structure/AtomCategory.cs index a394201..7e37f0e 100644 --- a/src/MfGames.Nitride.Feeds/Structure/AtomCategory.cs +++ b/src/MfGames.Nitride.Feeds/Structure/AtomCategory.cs @@ -36,7 +36,9 @@ public partial class AtomCategory throw new NullReferenceException("Category term cannot be null."); } - var elem = new XElement(XmlConstants.AtomNamespace + "category", new XAttribute("term", this.Term)); + var elem = new XElement( + XmlConstants.AtomNamespace + "category", + new XAttribute("term", this.Term)); if (this.Scheme != null) { diff --git a/src/MfGames.Nitride.Feeds/Structure/AtomHelper.cs b/src/MfGames.Nitride.Feeds/Structure/AtomHelper.cs index b94256a..5629faf 100644 --- a/src/MfGames.Nitride.Feeds/Structure/AtomHelper.cs +++ b/src/MfGames.Nitride.Feeds/Structure/AtomHelper.cs @@ -24,7 +24,10 @@ public static class AtomHelper { if (!string.IsNullOrWhiteSpace(text)) { - elem.Add(new XElement(XmlConstants.AtomNamespace + name, new XText(text))); + elem.Add( + new XElement( + XmlConstants.AtomNamespace + name, + new XText(text))); } } } diff --git a/src/MfGames.Nitride.Feeds/Structure/XmlConstants.cs b/src/MfGames.Nitride.Feeds/Structure/XmlConstants.cs index 2e966ad..4384189 100644 --- a/src/MfGames.Nitride.Feeds/Structure/XmlConstants.cs +++ b/src/MfGames.Nitride.Feeds/Structure/XmlConstants.cs @@ -10,10 +10,12 @@ public static class XmlConstants /// /// The XML namespace for Atom feeds. /// - public static readonly XNamespace AtomNamespace = "http://www.w3.org/2005/Atom"; + public static readonly XNamespace AtomNamespace = + "http://www.w3.org/2005/Atom"; /// /// The XML namespace for media. /// - public static readonly XNamespace MediaNamespace = "http://search.yahoo.com/mrss/"; + public static readonly XNamespace MediaNamespace = + "http://search.yahoo.com/mrss/"; } diff --git a/src/MfGames.Nitride.Gemtext/NitrideGemtextBuilderExtensions.cs b/src/MfGames.Nitride.Gemtext/NitrideGemtextBuilderExtensions.cs index 4c57603..0ad98e0 100644 --- a/src/MfGames.Nitride.Gemtext/NitrideGemtextBuilderExtensions.cs +++ b/src/MfGames.Nitride.Gemtext/NitrideGemtextBuilderExtensions.cs @@ -6,6 +6,7 @@ public static class NitrideGemtextBuilderExtensions { public static NitrideBuilder UseGemtext(this NitrideBuilder builder) { - return builder.ConfigureContainer(x => x.RegisterModule()); + return builder.ConfigureContainer( + x => x.RegisterModule()); } } diff --git a/src/MfGames.Nitride.Generators/CodeAnalysisExtensions.cs b/src/MfGames.Nitride.Generators/CodeAnalysisExtensions.cs index 3cca24f..3781d4f 100644 --- a/src/MfGames.Nitride.Generators/CodeAnalysisExtensions.cs +++ b/src/MfGames.Nitride.Generators/CodeAnalysisExtensions.cs @@ -38,7 +38,12 @@ public static class CodeAnalysisExtensions string format, params object[] parameters) { - context.Message(messageCode, location, DiagnosticSeverity.Error, format, parameters); + context.Message( + messageCode, + location, + DiagnosticSeverity.Error, + format, + parameters); } /// @@ -72,7 +77,12 @@ public static class CodeAnalysisExtensions string format, params object[] parameters) { - context.Message(messageCode, location, DiagnosticSeverity.Info, format, parameters); + context.Message( + messageCode, + location, + DiagnosticSeverity.Info, + format, + parameters); } /// @@ -106,7 +116,12 @@ public static class CodeAnalysisExtensions string format, params object[] parameters) { - context.Message(messageCode, location, DiagnosticSeverity.Warning, format, parameters); + context.Message( + messageCode, + location, + DiagnosticSeverity.Warning, + format, + parameters); } /// @@ -134,7 +149,10 @@ public static class CodeAnalysisExtensions severity, severity, true, - severity is DiagnosticSeverity.Warning or DiagnosticSeverity.Info ? 4 : 0, + severity is DiagnosticSeverity.Warning + or DiagnosticSeverity.Info + ? 4 + : 0, location: location)); } } diff --git a/src/MfGames.Nitride.Generators/MfGames.Nitride.Generators.csproj b/src/MfGames.Nitride.Generators/MfGames.Nitride.Generators.csproj index a5f7424..bdbc10a 100644 --- a/src/MfGames.Nitride.Generators/MfGames.Nitride.Generators.csproj +++ b/src/MfGames.Nitride.Generators/MfGames.Nitride.Generators.csproj @@ -10,10 +10,10 @@ - - - - + + + + diff --git a/src/MfGames.Nitride.Generators/WithPropertySourceGenerator.cs b/src/MfGames.Nitride.Generators/WithPropertySourceGenerator.cs index 1887e01..c9c7a48 100644 --- a/src/MfGames.Nitride.Generators/WithPropertySourceGenerator.cs +++ b/src/MfGames.Nitride.Generators/WithPropertySourceGenerator.cs @@ -22,7 +22,8 @@ public class WithPropertySourceGenerator : ISourceGenerator // Get the generator infrastructure will create a receiver and // populate it we can retrieve the populated instance via the // context. - var syntaxReceiver = (WithPropertySyntaxReceiver?)context.SyntaxReceiver; + var syntaxReceiver = + (WithPropertySyntaxReceiver?)context.SyntaxReceiver; if (syntaxReceiver == null) { @@ -37,7 +38,9 @@ public class WithPropertySourceGenerator : ISourceGenerator Location.Create( "Temporary.g.cs", TextSpan.FromBounds(0, 0), - new LinePositionSpan(new LinePosition(0, 0), new LinePosition(0, 0))), + new LinePositionSpan( + new LinePosition(0, 0), + new LinePosition(0, 0))), "Generating additional identifier code: {0}", message); } @@ -58,7 +61,8 @@ public class WithPropertySourceGenerator : ISourceGenerator public void Initialize(GeneratorInitializationContext context) { // Register a factory that can create our custom syntax receiver - context.RegisterForSyntaxNotifications(() => new WithPropertySyntaxReceiver(context)); + context.RegisterForSyntaxNotifications( + () => new WithPropertySyntaxReceiver(context)); } private void GenerateClassFile( @@ -96,7 +100,10 @@ public class WithPropertySourceGenerator : ISourceGenerator foreach (PropertyDeclarationSyntax pds in properties) { // See if we have a setter. - bool found = pds.AccessorList?.Accessors.Any(x => x.Keyword.ToString() == "set") ?? false; + bool found = + pds.AccessorList?.Accessors.Any( + x => x.Keyword.ToString() == "set") + ?? false; if (!found) { @@ -132,7 +139,8 @@ public class WithPropertySourceGenerator : ISourceGenerator pds.Type)); buffer.AppendLine(" {"); - buffer.AppendLine(string.Format(" this.{0} = value;", pds.Identifier)); + buffer.AppendLine( + string.Format(" this.{0} = value;", pds.Identifier)); buffer.AppendLine(" return this;"); buffer.AppendLine(" }"); } diff --git a/src/MfGames.Nitride.Handlebars/ApplyStyleTemplate.cs b/src/MfGames.Nitride.Handlebars/ApplyStyleTemplate.cs index 7261576..e50fb1c 100644 --- a/src/MfGames.Nitride.Handlebars/ApplyStyleTemplate.cs +++ b/src/MfGames.Nitride.Handlebars/ApplyStyleTemplate.cs @@ -3,10 +3,9 @@ using System.Collections.Generic; using FluentValidation; -using MfGames.Gallium; - using HandlebarsDotNet; +using MfGames.Gallium; using MfGames.Nitride.Contents; namespace MfGames.Nitride.Handlebars; @@ -61,7 +60,8 @@ public partial class ApplyStyleTemplate : OperationBase { object model = this.CreateModelCallback!(entity); string name = this.GetTemplateName!(entity); - HandlebarsTemplate template = this.cache.GetNamedTemplate(name); + HandlebarsTemplate template = + this.cache.GetNamedTemplate(name); string result = template(model!); return entity.SetTextContent(result); diff --git a/src/MfGames.Nitride.Handlebars/Configuration/ForEachHandlebarsBlock.cs b/src/MfGames.Nitride.Handlebars/Configuration/ForEachHandlebarsBlock.cs index 12cd733..db92562 100644 --- a/src/MfGames.Nitride.Handlebars/Configuration/ForEachHandlebarsBlock.cs +++ b/src/MfGames.Nitride.Handlebars/Configuration/ForEachHandlebarsBlock.cs @@ -23,12 +23,14 @@ public class ForEachHandlebarsBlock : HandlebarsBlockBase /// /// Gets or sets the callback that is called when nothing is found. /// - public Action? NothingFound { get; set; } + public Action? + NothingFound { get; set; } /// protected override string HelperName { get; } - public ForEachHandlebarsBlock WithGetList(Func>? callback) + public ForEachHandlebarsBlock WithGetList( + Func>? callback) { this.GetList = callback; @@ -36,7 +38,8 @@ public class ForEachHandlebarsBlock : HandlebarsBlockBase } public ForEachHandlebarsBlock WithNothingFoundText( - Action? callback) + Action? + callback) { this.NothingFound = callback; diff --git a/src/MfGames.Nitride.Handlebars/HandlebarsTemplateCache.cs b/src/MfGames.Nitride.Handlebars/HandlebarsTemplateCache.cs index ce945e3..6bd8a68 100644 --- a/src/MfGames.Nitride.Handlebars/HandlebarsTemplateCache.cs +++ b/src/MfGames.Nitride.Handlebars/HandlebarsTemplateCache.cs @@ -16,13 +16,15 @@ public class HandlebarsTemplateCache private readonly ModificationSynchronizer locker; - private readonly Dictionary> templates; + private readonly Dictionary> + templates; public HandlebarsTemplateCache(IHandlebars handlebars) { this.handlebars = handlebars; this.locker = new ModificationSynchronizer(); - this.templates = new Dictionary>(); + this.templates = + new Dictionary>(); } /// @@ -39,7 +41,8 @@ public class HandlebarsTemplateCache () => !this.templates.ContainsKey(literal), () => { - HandlebarsTemplate template = this.handlebars!.Compile(literal); + HandlebarsTemplate template = + this.handlebars!.Compile(literal); this.templates[literal] = template; @@ -56,7 +59,8 @@ public class HandlebarsTemplateCache /// /// /// - public HandlebarsTemplate GetNamedTemplate(string templateName) + public HandlebarsTemplate GetNamedTemplate( + string templateName) { string template = $"{{{{> {templateName}}}}}"; diff --git a/src/MfGames.Nitride.Handlebars/IdentifyHandlebarsFromComponent.cs b/src/MfGames.Nitride.Handlebars/IdentifyHandlebarsFromComponent.cs index 9bf9237..6907588 100644 --- a/src/MfGames.Nitride.Handlebars/IdentifyHandlebarsFromComponent.cs +++ b/src/MfGames.Nitride.Handlebars/IdentifyHandlebarsFromComponent.cs @@ -17,7 +17,8 @@ public partial class IdentifyHandlebarsFromComponent : IOperation { private readonly IValidator validator; - public IdentifyHandlebarsFromComponent(IValidator validator) + public IdentifyHandlebarsFromComponent( + IValidator validator) { this.validator = validator; } @@ -30,6 +31,8 @@ public partial class IdentifyHandlebarsFromComponent : IOperation this.validator.ValidateAndThrow(this); return input.Select( - (entity) => this.HasHandlebarsTest.Invoke(entity) ? entity.Set(HasHandlebarsTemplate.Instance) : entity); + (entity) => this.HasHandlebarsTest.Invoke(entity) + ? entity.Set(HasHandlebarsTemplate.Instance) + : entity); } } diff --git a/src/MfGames.Nitride.Handlebars/IdentifyHandlebarsFromComponentValidator.cs b/src/MfGames.Nitride.Handlebars/IdentifyHandlebarsFromComponentValidator.cs index 822297c..5cdbb7e 100644 --- a/src/MfGames.Nitride.Handlebars/IdentifyHandlebarsFromComponentValidator.cs +++ b/src/MfGames.Nitride.Handlebars/IdentifyHandlebarsFromComponentValidator.cs @@ -2,7 +2,8 @@ using FluentValidation; namespace MfGames.Nitride.Handlebars; -public class IdentifyHandlebarsFromComponentValidator : AbstractValidator +public class IdentifyHandlebarsFromComponentValidator + : AbstractValidator { public IdentifyHandlebarsFromComponentValidator() { diff --git a/src/MfGames.Nitride.Handlebars/IdentifyHandlebarsFromContent.cs b/src/MfGames.Nitride.Handlebars/IdentifyHandlebarsFromContent.cs index c385e03..5b763b9 100644 --- a/src/MfGames.Nitride.Handlebars/IdentifyHandlebarsFromContent.cs +++ b/src/MfGames.Nitride.Handlebars/IdentifyHandlebarsFromContent.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using MfGames.Gallium; - using MfGames.Nitride.Contents; namespace MfGames.Nitride.Handlebars; diff --git a/src/MfGames.Nitride.Handlebars/MfGames.Nitride.Handlebars.csproj b/src/MfGames.Nitride.Handlebars/MfGames.Nitride.Handlebars.csproj index 0f4997a..c6d4e92 100644 --- a/src/MfGames.Nitride.Handlebars/MfGames.Nitride.Handlebars.csproj +++ b/src/MfGames.Nitride.Handlebars/MfGames.Nitride.Handlebars.csproj @@ -10,15 +10,15 @@ - - - - - + + + + + - + diff --git a/src/MfGames.Nitride.Handlebars/NitrideHandlebarsBuilderExtensions.cs b/src/MfGames.Nitride.Handlebars/NitrideHandlebarsBuilderExtensions.cs index 3613571..9490bbb 100644 --- a/src/MfGames.Nitride.Handlebars/NitrideHandlebarsBuilderExtensions.cs +++ b/src/MfGames.Nitride.Handlebars/NitrideHandlebarsBuilderExtensions.cs @@ -12,7 +12,8 @@ public static class NitrideHandlebarsBuilderExtensions public static NitrideBuilder UseHandlebars(this NitrideBuilder builder) { return builder - .ConfigureContainer(x => x.RegisterModule()); + .ConfigureContainer( + x => x.RegisterModule()); } public static NitrideBuilder UseHandlebars( diff --git a/src/MfGames.Nitride.Handlebars/NitrideHandlebarsModule.cs b/src/MfGames.Nitride.Handlebars/NitrideHandlebarsModule.cs index 1c30e33..0f665a2 100644 --- a/src/MfGames.Nitride.Handlebars/NitrideHandlebarsModule.cs +++ b/src/MfGames.Nitride.Handlebars/NitrideHandlebarsModule.cs @@ -23,8 +23,10 @@ public class NitrideHandlebarsModule : Module builder.Register( (context) => { - IHandlebars handlebars = HandlebarsDotNet.Handlebars.Create(); - IEnumerable helpers = context.Resolve>(); + IHandlebars handlebars = + HandlebarsDotNet.Handlebars.Create(); + IEnumerable helpers = + context.Resolve>(); foreach (IHandlebarsLoader helper in helpers) { diff --git a/src/MfGames.Nitride.Handlebars/RenderContentTemplate.cs b/src/MfGames.Nitride.Handlebars/RenderContentTemplate.cs index 81aae83..4617a32 100644 --- a/src/MfGames.Nitride.Handlebars/RenderContentTemplate.cs +++ b/src/MfGames.Nitride.Handlebars/RenderContentTemplate.cs @@ -3,10 +3,9 @@ using System.Collections.Generic; using FluentValidation; -using MfGames.Gallium; - using HandlebarsDotNet; +using MfGames.Gallium; using MfGames.Nitride.Contents; namespace MfGames.Nitride.Handlebars; @@ -43,7 +42,8 @@ public partial class RenderContentTemplate : OperationBase { this.validator.ValidateAndThrow(this); - return input.SelectEntity(this.Apply); + return input.SelectEntity( + this.Apply); } private Entity Apply( @@ -52,7 +52,8 @@ public partial class RenderContentTemplate : OperationBase ITextContent content) { string text = content.GetText(); - HandlebarsTemplate template = this.cache.GetLiteralTemplate(text); + HandlebarsTemplate template = + this.cache.GetLiteralTemplate(text); object model = this.CreateModelCallback!(entity); string result = template(model!); diff --git a/src/MfGames.Nitride.Handlebars/RenderContentTemplateValidator.cs b/src/MfGames.Nitride.Handlebars/RenderContentTemplateValidator.cs index fc4b9ee..85066a4 100644 --- a/src/MfGames.Nitride.Handlebars/RenderContentTemplateValidator.cs +++ b/src/MfGames.Nitride.Handlebars/RenderContentTemplateValidator.cs @@ -2,7 +2,8 @@ using FluentValidation; namespace MfGames.Nitride.Handlebars; -public class RenderContentTemplateValidator : AbstractValidator +public class RenderContentTemplateValidator + : AbstractValidator { public RenderContentTemplateValidator() { diff --git a/src/MfGames.Nitride.Html/ConvertHtmlEntitiesToUnicode.cs b/src/MfGames.Nitride.Html/ConvertHtmlEntitiesToUnicode.cs index 79d729c..d749e62 100644 --- a/src/MfGames.Nitride.Html/ConvertHtmlEntitiesToUnicode.cs +++ b/src/MfGames.Nitride.Html/ConvertHtmlEntitiesToUnicode.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Net; using MfGames.Gallium; - using MfGames.Nitride.Contents; namespace MfGames.Nitride.Html; diff --git a/src/MfGames.Nitride.Html/MfGames.Nitride.Html.csproj b/src/MfGames.Nitride.Html/MfGames.Nitride.Html.csproj index cd58087..91923b8 100644 --- a/src/MfGames.Nitride.Html/MfGames.Nitride.Html.csproj +++ b/src/MfGames.Nitride.Html/MfGames.Nitride.Html.csproj @@ -9,7 +9,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/src/MfGames.Nitride.Html/NitrideHtmlBuilderExtensions.cs b/src/MfGames.Nitride.Html/NitrideHtmlBuilderExtensions.cs index 1f50108..9251635 100644 --- a/src/MfGames.Nitride.Html/NitrideHtmlBuilderExtensions.cs +++ b/src/MfGames.Nitride.Html/NitrideHtmlBuilderExtensions.cs @@ -6,6 +6,7 @@ public static class NitrideHtmlBuilderExtensions { public static NitrideBuilder UseHtml(this NitrideBuilder builder) { - return builder.ConfigureContainer(x => x.RegisterModule()); + return builder.ConfigureContainer( + x => x.RegisterModule()); } } diff --git a/src/MfGames.Nitride.IO/Contents/FileEntryTextContent.cs b/src/MfGames.Nitride.IO/Contents/FileEntryTextContent.cs index 18b874b..77a1e8c 100644 --- a/src/MfGames.Nitride.IO/Contents/FileEntryTextContent.cs +++ b/src/MfGames.Nitride.IO/Contents/FileEntryTextContent.cs @@ -22,7 +22,9 @@ public class FileEntryTextContent : ITextContent, IBinaryContentConvertable /// public TextReader GetReader() { - return new StreamReader(this.entry.Open(FileMode.Open, FileAccess.Read, FileShare.Read), Encoding.UTF8); + return new StreamReader( + this.entry.Open(FileMode.Open, FileAccess.Read, FileShare.Read), + Encoding.UTF8); } /// diff --git a/src/MfGames.Nitride.IO/Contents/ReadFiles.cs b/src/MfGames.Nitride.IO/Contents/ReadFiles.cs index 79caf0b..8e34fe2 100644 --- a/src/MfGames.Nitride.IO/Contents/ReadFiles.cs +++ b/src/MfGames.Nitride.IO/Contents/ReadFiles.cs @@ -8,7 +8,6 @@ using DotNet.Globbing; using FluentValidation; using MfGames.Gallium; - using MfGames.Nitride.Contents; using Zio; @@ -59,7 +58,8 @@ public partial class ReadFiles : FileSystemOperationBase var glob = Glob.Parse(this.Pattern); - IEnumerable files = this.FileSystem.EnumerateFileEntries("/", "*", SearchOption.AllDirectories) + IEnumerable files = this.FileSystem + .EnumerateFileEntries("/", "*", SearchOption.AllDirectories) .Where(x => glob.IsMatch(x.Path.ToString())); IEnumerable entities = files.Select(this.ToEntity); diff --git a/src/MfGames.Nitride.IO/Contents/WriteFiles.cs b/src/MfGames.Nitride.IO/Contents/WriteFiles.cs index 76c90a6..a03af8b 100644 --- a/src/MfGames.Nitride.IO/Contents/WriteFiles.cs +++ b/src/MfGames.Nitride.IO/Contents/WriteFiles.cs @@ -7,7 +7,6 @@ using System.Text; using FluentValidation; using MfGames.Gallium; - using MfGames.Nitride.Contents; using Serilog; @@ -48,7 +47,8 @@ public partial class WriteFiles : FileSystemOperationBase, IOperation public Dictionary> StreamFactories { get => this.factories; - set => this.factories = value ?? throw new ArgumentNullException(nameof(value)); + set => this.factories = + value ?? throw new ArgumentNullException(nameof(value)); } /// @@ -102,7 +102,9 @@ public partial class WriteFiles : FileSystemOperationBase, IOperation .ReadToEnd(); var stream = new MemoryStream(); - var writer = new StreamWriter(stream, this.TextEncoding ?? Encoding.UTF8); + var writer = new StreamWriter( + stream, + this.TextEncoding ?? Encoding.UTF8); writer.Write(text); writer.Flush(); @@ -133,7 +135,9 @@ public partial class WriteFiles : FileSystemOperationBase, IOperation // First see if we have a factory for the exact type of content. IContent content = entity.GetContent(); - if (this.factories.TryGetValue(content.GetType(), out Func? getStream)) + if (this.factories.TryGetValue( + content.GetType(), + out Func? getStream)) { Stream stream = getStream(content); @@ -143,7 +147,9 @@ public partial class WriteFiles : FileSystemOperationBase, IOperation // If we have an easy conversion, then use that so we don't have to // walk up the tree looking for one we do have. if (content is IBinaryContentConvertable binaryConvertable - && this.factories.TryGetValue(typeof(IBinaryContent), out Func? binaryContent)) + && this.factories.TryGetValue( + typeof(IBinaryContent), + out Func? binaryContent)) { Stream stream = binaryContent(binaryConvertable.ToBinaryContent()); @@ -151,7 +157,9 @@ public partial class WriteFiles : FileSystemOperationBase, IOperation } if (content is ITextContentConvertable textConvertable - && this.factories.TryGetValue(typeof(ITextContent), out Func? textContent)) + && this.factories.TryGetValue( + typeof(ITextContent), + out Func? textContent)) { Stream stream = textContent(textConvertable.ToTextContent()); @@ -167,7 +175,12 @@ public partial class WriteFiles : FileSystemOperationBase, IOperation { // Check to see if we have any of these types. Func? found = types - .Select(x => this.factories.TryGetValue(x, out Func? factory) ? factory : null) + .Select( + x => this.factories.TryGetValue( + x, + out Func? factory) + ? factory + : null) .FirstOrDefault(x => x != null); if (found != null) @@ -179,7 +192,8 @@ public partial class WriteFiles : FileSystemOperationBase, IOperation // We didn't find one, so add all the parent types and try // again with the new list. - types = types.SelectMany(x => new[] { x.BaseType }.Union(x.GetInterfaces())) + types = types + .SelectMany(x => new[] { x.BaseType }.Union(x.GetInterfaces())) .Where(x => x != null) .Select(x => x!) .ToList(); diff --git a/src/MfGames.Nitride.IO/Directories/ClearDirectory.cs b/src/MfGames.Nitride.IO/Directories/ClearDirectory.cs index b4c6e0f..7ff0668 100644 --- a/src/MfGames.Nitride.IO/Directories/ClearDirectory.cs +++ b/src/MfGames.Nitride.IO/Directories/ClearDirectory.cs @@ -71,7 +71,8 @@ public partial class ClearDirectory : FileSystemOperationBase, IOperation // Clear out the contents. IEnumerable files = this.FileSystem.EnumerateFiles(path); - IEnumerable directories = this.FileSystem.EnumerateDirectories(path); + IEnumerable directories = + this.FileSystem.EnumerateDirectories(path); foreach (UPath file in files) { diff --git a/src/MfGames.Nitride.IO/MfGames.Nitride.IO.csproj b/src/MfGames.Nitride.IO/MfGames.Nitride.IO.csproj index e17c6e0..928fe60 100644 --- a/src/MfGames.Nitride.IO/MfGames.Nitride.IO.csproj +++ b/src/MfGames.Nitride.IO/MfGames.Nitride.IO.csproj @@ -8,17 +8,17 @@ - - - - - - - + + + + + + + - + diff --git a/src/MfGames.Nitride.IO/NitrideIOBuilderExtensions.cs b/src/MfGames.Nitride.IO/NitrideIOBuilderExtensions.cs index d19efd8..a62ba4d 100644 --- a/src/MfGames.Nitride.IO/NitrideIOBuilderExtensions.cs +++ b/src/MfGames.Nitride.IO/NitrideIOBuilderExtensions.cs @@ -6,6 +6,7 @@ public static class NitrideIOBuilderExtensions { public static NitrideBuilder UseIO(this NitrideBuilder builder) { - return builder.ConfigureContainer(x => x.RegisterModule()); + return builder.ConfigureContainer( + x => x.RegisterModule()); } } diff --git a/src/MfGames.Nitride.IO/NitrideIOEnumerableEntityExtensions.cs b/src/MfGames.Nitride.IO/NitrideIOEnumerableEntityExtensions.cs index cd0868f..e9cb38d 100644 --- a/src/MfGames.Nitride.IO/NitrideIOEnumerableEntityExtensions.cs +++ b/src/MfGames.Nitride.IO/NitrideIOEnumerableEntityExtensions.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; -using MfGames.Gallium; - using MAB.DotIgnore; +using MfGames.Gallium; + using Zio; namespace MfGames.Nitride.IO; diff --git a/src/MfGames.Nitride.IO/Paths/ChangePathExtensionValidator.cs b/src/MfGames.Nitride.IO/Paths/ChangePathExtensionValidator.cs index cc7e564..1c46324 100644 --- a/src/MfGames.Nitride.IO/Paths/ChangePathExtensionValidator.cs +++ b/src/MfGames.Nitride.IO/Paths/ChangePathExtensionValidator.cs @@ -2,7 +2,8 @@ using FluentValidation; namespace MfGames.Nitride.IO.Paths; -public class ChangePathExtensionValidator : AbstractValidator +public class ChangePathExtensionValidator + : AbstractValidator { public ChangePathExtensionValidator() { diff --git a/src/MfGames.Nitride.IO/Paths/DirectChildPathScanner.cs b/src/MfGames.Nitride.IO/Paths/DirectChildPathScanner.cs index ca7618f..66e4072 100644 --- a/src/MfGames.Nitride.IO/Paths/DirectChildPathScanner.cs +++ b/src/MfGames.Nitride.IO/Paths/DirectChildPathScanner.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using FluentValidation; using MfGames.Gallium; - using MfGames.Nitride.Entities; using Zio; @@ -41,6 +40,8 @@ public partial class DirectChildPathScanner : EntityScanner // If we are using directory indexes, skip when we have an index root. // Otherwise, get the parent and use that as the key. - return path.GetDirectoryIndexPath() == "/" ? null : new[] { path.GetParentDirectoryIndexPath() }; + return path.GetDirectoryIndexPath() == "/" + ? null + : new[] { path.GetParentDirectoryIndexPath() }; } } diff --git a/src/MfGames.Nitride.IO/Paths/LinkDirectChildren.cs b/src/MfGames.Nitride.IO/Paths/LinkDirectChildren.cs index a35006a..d0dac85 100644 --- a/src/MfGames.Nitride.IO/Paths/LinkDirectChildren.cs +++ b/src/MfGames.Nitride.IO/Paths/LinkDirectChildren.cs @@ -4,7 +4,6 @@ using System.Linq; using FluentValidation; using MfGames.Gallium; - using MfGames.Nitride.Entities; using Serilog; diff --git a/src/MfGames.Nitride.IO/README.md b/src/MfGames.Nitride.IO/README.md index 2b62695..6ef044f 100644 --- a/src/MfGames.Nitride.IO/README.md +++ b/src/MfGames.Nitride.IO/README.md @@ -4,9 +4,9 @@ This assembly contains the primary system for reading and writing from the disk, along with various processes to manipulate paths. It contains three primary components: -- File System I/O -- Path Normalization -- Disk-Based Content +- File System I/O +- Path Normalization +- Disk-Based Content ## File System I/O diff --git a/src/MfGames.Nitride.Markdown/ConvertMarkdownToBase.cs b/src/MfGames.Nitride.Markdown/ConvertMarkdownToBase.cs index 367f8c7..e5c5b5d 100644 --- a/src/MfGames.Nitride.Markdown/ConvertMarkdownToBase.cs +++ b/src/MfGames.Nitride.Markdown/ConvertMarkdownToBase.cs @@ -3,10 +3,9 @@ using System.Collections.Generic; using FluentValidation; -using MfGames.Gallium; - using Markdig; +using MfGames.Gallium; using MfGames.Nitride.Contents; namespace MfGames.Nitride.Markdown; diff --git a/src/MfGames.Nitride.Markdown/ConvertMarkdownToBaseValidator.cs b/src/MfGames.Nitride.Markdown/ConvertMarkdownToBaseValidator.cs index 3759fe2..e49872e 100644 --- a/src/MfGames.Nitride.Markdown/ConvertMarkdownToBaseValidator.cs +++ b/src/MfGames.Nitride.Markdown/ConvertMarkdownToBaseValidator.cs @@ -2,7 +2,8 @@ using FluentValidation; namespace MfGames.Nitride.Markdown; -public class ConvertMarkdownToBaseValidator : AbstractValidator +public class ConvertMarkdownToBaseValidator + : AbstractValidator { public ConvertMarkdownToBaseValidator() { diff --git a/src/MfGames.Nitride.Markdown/ConvertMarkdownToGemtext.cs b/src/MfGames.Nitride.Markdown/ConvertMarkdownToGemtext.cs index bc8fa8b..fddf29d 100644 --- a/src/MfGames.Nitride.Markdown/ConvertMarkdownToGemtext.cs +++ b/src/MfGames.Nitride.Markdown/ConvertMarkdownToGemtext.cs @@ -2,12 +2,10 @@ using System; using FluentValidation; -using MfGames.Gallium; - using Markdig; +using MfGames.Gallium; using MfGames.Markdown.Gemtext; - using MfGames.Nitride.Contents; using MfGames.Nitride.Gemtext; @@ -26,7 +24,8 @@ public class ConvertMarkdownToGemtext : ConvertMarkdownToBase } /// - public override ConvertMarkdownToGemtext WithConfigureMarkdown(Action? value) + public override ConvertMarkdownToGemtext WithConfigureMarkdown( + Action? value) { base.WithConfigureMarkdown(value); diff --git a/src/MfGames.Nitride.Markdown/ConvertMarkdownToHtml.cs b/src/MfGames.Nitride.Markdown/ConvertMarkdownToHtml.cs index 474e00f..607f443 100644 --- a/src/MfGames.Nitride.Markdown/ConvertMarkdownToHtml.cs +++ b/src/MfGames.Nitride.Markdown/ConvertMarkdownToHtml.cs @@ -2,10 +2,9 @@ using System; using FluentValidation; -using MfGames.Gallium; - using Markdig; +using MfGames.Gallium; using MfGames.Nitride.Contents; using MfGames.Nitride.Html; @@ -23,7 +22,8 @@ public class ConvertMarkdownToHtml : ConvertMarkdownToBase } /// - public override ConvertMarkdownToHtml WithConfigureMarkdown(Action? value) + public override ConvertMarkdownToHtml WithConfigureMarkdown( + Action? value) { base.WithConfigureMarkdown(value); diff --git a/src/MfGames.Nitride.Markdown/IdentifyMarkdown.cs b/src/MfGames.Nitride.Markdown/IdentifyMarkdown.cs index bcaab7f..78c59a0 100644 --- a/src/MfGames.Nitride.Markdown/IdentifyMarkdown.cs +++ b/src/MfGames.Nitride.Markdown/IdentifyMarkdown.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using FluentValidation; using MfGames.Gallium; - using MfGames.Nitride.Contents; using Zio; diff --git a/src/MfGames.Nitride.Markdown/IdentifyMarkdownFromPath.cs b/src/MfGames.Nitride.Markdown/IdentifyMarkdownFromPath.cs index 5d98775..67e083f 100644 --- a/src/MfGames.Nitride.Markdown/IdentifyMarkdownFromPath.cs +++ b/src/MfGames.Nitride.Markdown/IdentifyMarkdownFromPath.cs @@ -18,11 +18,12 @@ public class IdentifyMarkdownFromPath : IdentifyMarkdown Entity entity, UPath path) { - return (path.GetExtensionWithDot() ?? string.Empty).ToLowerInvariant() switch - { - ".md" => true, - ".markdown" => true, - _ => false, - }; + return (path.GetExtensionWithDot() ?? string.Empty).ToLowerInvariant() + switch + { + ".md" => true, + ".markdown" => true, + _ => false, + }; } } diff --git a/src/MfGames.Nitride.Markdown/MakeSingleLinkListItems.cs b/src/MfGames.Nitride.Markdown/MakeSingleLinkListItems.cs index 85ab750..687180f 100644 --- a/src/MfGames.Nitride.Markdown/MakeSingleLinkListItems.cs +++ b/src/MfGames.Nitride.Markdown/MakeSingleLinkListItems.cs @@ -85,9 +85,6 @@ public class MakeSingleLinkListItems : IOperation match => { string link1 = match.Groups["label"].ToString(); - string path1 = string.Format( - "/{0}/", - this.slugs.ToSlug(link1.Split('|').First())); string label1 = link1.Split('|').Last(); return label1; diff --git a/src/MfGames.Nitride.Markdown/MfGames.Nitride.Markdown.csproj b/src/MfGames.Nitride.Markdown/MfGames.Nitride.Markdown.csproj index 1423891..cd5884b 100644 --- a/src/MfGames.Nitride.Markdown/MfGames.Nitride.Markdown.csproj +++ b/src/MfGames.Nitride.Markdown/MfGames.Nitride.Markdown.csproj @@ -10,17 +10,17 @@ - - - - + + + + - - - - + + + + diff --git a/src/MfGames.Nitride.Markdown/NitrideMarkdownBuilderExtensions.cs b/src/MfGames.Nitride.Markdown/NitrideMarkdownBuilderExtensions.cs index 4434017..334db50 100644 --- a/src/MfGames.Nitride.Markdown/NitrideMarkdownBuilderExtensions.cs +++ b/src/MfGames.Nitride.Markdown/NitrideMarkdownBuilderExtensions.cs @@ -6,6 +6,7 @@ public static class NitrideMarkdownBuilderExtensions { public static NitrideBuilder UseMarkdown(this NitrideBuilder builder) { - return builder.ConfigureContainer(x => x.RegisterModule()); + return builder.ConfigureContainer( + x => x.RegisterModule()); } } diff --git a/src/MfGames.Nitride.Slugs/SimpleSlugConverter.cs b/src/MfGames.Nitride.Slugs/SimpleSlugConverter.cs index f39092a..4c93237 100644 --- a/src/MfGames.Nitride.Slugs/SimpleSlugConverter.cs +++ b/src/MfGames.Nitride.Slugs/SimpleSlugConverter.cs @@ -21,7 +21,8 @@ public class SimpleSlugConverter : ISlugConverter, IEnumerable public SimpleSlugConverter( IDictionary replacements, - StringComparison comparison = StringComparison.InvariantCultureIgnoreCase) + StringComparison comparison = + StringComparison.InvariantCultureIgnoreCase) : this() { foreach (KeyValuePair pair in replacements) @@ -44,7 +45,8 @@ public class SimpleSlugConverter : ISlugConverter, IEnumerable public void Add( string search, string replace, - StringComparison comparison = StringComparison.InvariantCultureIgnoreCase) + StringComparison comparison = + StringComparison.InvariantCultureIgnoreCase) { this.replacements.Add((search, replace, comparison)); } @@ -62,12 +64,15 @@ public class SimpleSlugConverter : ISlugConverter, IEnumerable // If we have null or whitespace, we have a problem. if (string.IsNullOrWhiteSpace(input)) { - throw new ArgumentException("Cannot have a blank or null input", nameof(input)); + throw new ArgumentException( + "Cannot have a blank or null input", + nameof(input)); } // We need to do the replacements before we slugify. // Perform any additional replacements. - foreach ((string search, string replace, StringComparison comparison) in this.replacements) + foreach ((string search, string replace, StringComparison comparison) in + this.replacements) { input = input.Replace(search, replace, comparison); } diff --git a/src/MfGames.Nitride.Slugs/UnicodeNormalizingSlugConverter.cs b/src/MfGames.Nitride.Slugs/UnicodeNormalizingSlugConverter.cs index 661bfe1..ea02c3d 100644 --- a/src/MfGames.Nitride.Slugs/UnicodeNormalizingSlugConverter.cs +++ b/src/MfGames.Nitride.Slugs/UnicodeNormalizingSlugConverter.cs @@ -18,7 +18,8 @@ public class UnicodeNormalizingSlugConverter : SimpleSlugConverter } /// - public UnicodeNormalizingSlugConverter(IDictionary replacements) + public UnicodeNormalizingSlugConverter( + IDictionary replacements) : base(replacements) { } @@ -29,7 +30,9 @@ public class UnicodeNormalizingSlugConverter : SimpleSlugConverter // If we have null or whitespace, we have a problem. if (string.IsNullOrWhiteSpace(input)) { - throw new ArgumentException("Cannot have a blank or null input", nameof(input)); + throw new ArgumentException( + "Cannot have a blank or null input", + nameof(input)); } // Normalize the Unicode objects. @@ -38,7 +41,8 @@ public class UnicodeNormalizingSlugConverter : SimpleSlugConverter .Where(this.IsNonSpacingMark) .ToArray(); - string normalized = new string(chars).Normalize(NormalizationForm.FormC); + string normalized = + new string(chars).Normalize(NormalizationForm.FormC); // Return the base implementation. return base.ToSlug(normalized); diff --git a/src/MfGames.Nitride.Temporal/Cli/DatePipelineCommandOption.cs b/src/MfGames.Nitride.Temporal/Cli/DatePipelineCommandOption.cs index d1981ea..314ff44 100644 --- a/src/MfGames.Nitride.Temporal/Cli/DatePipelineCommandOption.cs +++ b/src/MfGames.Nitride.Temporal/Cli/DatePipelineCommandOption.cs @@ -44,14 +44,16 @@ public class DatePipelineCommandOption : IPipelineCommandOption { // If we got a date, then use NodaTime's fake clock to set it so // everything will use that. - var value = (DateTime?)context.ParseResult.GetValueForOption(this.Option); + var value = + (DateTime?)context.ParseResult.GetValueForOption(this.Option); if (value.HasValue && value.Value != DateTime.MinValue) { // We have a date, so we need to create a fake clock that has this // date for the entire run. var local = LocalDateTime.FromDateTime(value.Value); - ZonedDateTime zoned = local.InZoneStrictly(this.timekeeper.DateTimeZone); + ZonedDateTime zoned = + local.InZoneStrictly(this.timekeeper.DateTimeZone); var instant = zoned.ToInstant(); this.timekeeper.Clock = new FakeClock(instant); diff --git a/src/MfGames.Nitride.Temporal/Cli/ExpiresPipelineCommandOption.cs b/src/MfGames.Nitride.Temporal/Cli/ExpiresPipelineCommandOption.cs index c2f5ddd..b48a0fa 100644 --- a/src/MfGames.Nitride.Temporal/Cli/ExpiresPipelineCommandOption.cs +++ b/src/MfGames.Nitride.Temporal/Cli/ExpiresPipelineCommandOption.cs @@ -32,7 +32,8 @@ public class ExpiresPipelineCommandOption : IPipelineCommandOption this.Option = new Option("--expires", () => defaultValue) { - Description = "Sets the expiration time as time before the current date", + Description = + "Sets the expiration time as time before the current date", ArgumentHelpName = "TIMESPAN", }; } @@ -46,7 +47,8 @@ public class ExpiresPipelineCommandOption : IPipelineCommandOption // If we have a format, then we are going to set one. If the format // is blank or never, then we are going to treat it as not // expiring anything. - string? value = (string?)context.ParseResult.GetValueForOption(this.Option); + string? value = + (string?)context.ParseResult.GetValueForOption(this.Option); if (value != null && value.ToLowerInvariant() != "never") { @@ -65,7 +67,9 @@ public class ExpiresPipelineCommandOption : IPipelineCommandOption // Figure out when we are going to be expiring. Instant when = this.clock.Expiration.Value; ZonedDateTime dateTime = when.InZone(this.clock.DateTimeZone); - string formatted = dateTime.ToString("yyyy-MM-dd HH:mm:ss x", CultureInfo.CurrentCulture); + string formatted = dateTime.ToString( + "yyyy-MM-dd HH:mm:ss x", + CultureInfo.CurrentCulture); this.logger.Information("Expiring entries before {When:l}", formatted); } diff --git a/src/MfGames.Nitride.Temporal/CreateDateIndexes.cs b/src/MfGames.Nitride.Temporal/CreateDateIndexes.cs index bbe18c6..f13a3b0 100644 --- a/src/MfGames.Nitride.Temporal/CreateDateIndexes.cs +++ b/src/MfGames.Nitride.Temporal/CreateDateIndexes.cs @@ -10,21 +10,6 @@ using NodaTime; namespace MfGames.Nitride.Temporal; -public class CreateDateIndexesValidator : AbstractValidator -{ - public CreateDateIndexesValidator() - { - this.RuleFor(a => a.Timekeeper) - .NotNull(); - - this.RuleFor(a => a.CreateIndex) - .NotNull(); - - this.RuleFor(a => a.Formats) - .NotNull(); - } -} - /// /// Constructs indexes for any arbitrary formatting of date time to allow for /// nested structures. This takes a list @@ -116,17 +101,24 @@ public partial class CreateDateIndexes : OperationBase, IResolvingOperation // The new entities are going to always be added, but if the new + seen is <= the threshold, we'll be // including both of them. - List? childEntities = (newEntities.Count + seenEntities.Count) <= this.LessThanEqualCollapse - ? pair.Value - : newEntities; + List? childEntities = + (newEntities.Count + seenEntities.Count) + <= this.LessThanEqualCollapse + ? pair.Value + : newEntities; // Figure out which child indexes need to be included. If there isn't a list, then return an empty one. - List? childIndexes = indexes.TryGetValue(pair.Key, out List? list) - ? list - : new List(); + List? childIndexes = + indexes.TryGetValue(pair.Key, out List? list) + ? list + : new List(); // Create the index then add it to the output list. - var index = new DateIndex(pair.Key, this.Formats[i], childEntities, childIndexes); + var index = new DateIndex( + pair.Key, + this.Formats[i], + childEntities, + childIndexes); Entity? indexEntity = this.CreateIndex!(index); output.Add(indexEntity); @@ -140,7 +132,8 @@ public partial class CreateDateIndexes : OperationBase, IResolvingOperation Entity? first = pair.Value[0]; - string? nextKey = this.Timekeeper.ToDateTime(first.Get()) + string? nextKey = this.Timekeeper + .ToDateTime(first.Get()) .ToString(this.Formats[i + 1]); if (!indexes.ContainsKey(nextKey)) @@ -176,7 +169,7 @@ public partial class CreateDateIndexes : OperationBase, IResolvingOperation string? formatted = dateTime.ToString(this.Formats[i]); if (!grouped[i] - .ContainsKey(formatted)) + .ContainsKey(formatted)) { grouped[i][formatted] = new List(); } diff --git a/src/MfGames.Nitride.Temporal/CreateDateIndexesValidator.cs b/src/MfGames.Nitride.Temporal/CreateDateIndexesValidator.cs new file mode 100644 index 0000000..b1058f9 --- /dev/null +++ b/src/MfGames.Nitride.Temporal/CreateDateIndexesValidator.cs @@ -0,0 +1,18 @@ +using FluentValidation; + +namespace MfGames.Nitride.Temporal; + +public class CreateDateIndexesValidator : AbstractValidator +{ + public CreateDateIndexesValidator() + { + this.RuleFor(a => a.Timekeeper) + .NotNull(); + + this.RuleFor(a => a.CreateIndex) + .NotNull(); + + this.RuleFor(a => a.Formats) + .NotNull(); + } +} diff --git a/src/MfGames.Nitride.Temporal/FilterOutExpiredInstantValidator.cs b/src/MfGames.Nitride.Temporal/FilterOutExpiredInstantValidator.cs index 6100cc0..db2cb31 100644 --- a/src/MfGames.Nitride.Temporal/FilterOutExpiredInstantValidator.cs +++ b/src/MfGames.Nitride.Temporal/FilterOutExpiredInstantValidator.cs @@ -2,7 +2,8 @@ using FluentValidation; namespace MfGames.Nitride.Temporal; -public class FilterOutExpiredInstantValidator : AbstractValidator +public class FilterOutExpiredInstantValidator + : AbstractValidator { public FilterOutExpiredInstantValidator() { diff --git a/src/MfGames.Nitride.Temporal/FilterOutFutureInstantValidator.cs b/src/MfGames.Nitride.Temporal/FilterOutFutureInstantValidator.cs index 64145c3..e412c87 100644 --- a/src/MfGames.Nitride.Temporal/FilterOutFutureInstantValidator.cs +++ b/src/MfGames.Nitride.Temporal/FilterOutFutureInstantValidator.cs @@ -2,7 +2,8 @@ using FluentValidation; namespace MfGames.Nitride.Temporal; -public class FilterOutFutureInstantValidator : AbstractValidator +public class FilterOutFutureInstantValidator + : AbstractValidator { public FilterOutFutureInstantValidator() { diff --git a/src/MfGames.Nitride.Temporal/MfGames.Nitride.Temporal.csproj b/src/MfGames.Nitride.Temporal/MfGames.Nitride.Temporal.csproj index 0cc3a05..d7f0861 100644 --- a/src/MfGames.Nitride.Temporal/MfGames.Nitride.Temporal.csproj +++ b/src/MfGames.Nitride.Temporal/MfGames.Nitride.Temporal.csproj @@ -11,18 +11,18 @@ - - - - - - - - + + + + + + + + - + diff --git a/src/MfGames.Nitride.Temporal/NitrideTemporalBuilderExtensions.cs b/src/MfGames.Nitride.Temporal/NitrideTemporalBuilderExtensions.cs index 1b66a4d..edb5b85 100644 --- a/src/MfGames.Nitride.Temporal/NitrideTemporalBuilderExtensions.cs +++ b/src/MfGames.Nitride.Temporal/NitrideTemporalBuilderExtensions.cs @@ -7,8 +7,6 @@ using MfGames.Nitride.Temporal.Cli; using Serilog; -using Expires = MfGames.Nitride.Temporal.Cli.ExpiresPipelineCommandOption; - namespace MfGames.Nitride.Temporal; public static class NitrideTemporalBuilderExtensions @@ -40,15 +38,20 @@ public static class NitrideTemporalBuilderExtensions .As(); } - if (config.AddExpireOptionToCommandLine && config.Expiration != null) + if (config.AddExpireOptionToCommandLine + && config.Expiration != null) { x.Register( context => { ILogger logger = context.Resolve(); - Timekeeper clock = context.Resolve(); + Timekeeper + clock = context.Resolve(); - return new Expires(logger, clock, config.Expiration); + return new ExpiresPipelineCommandOption( + logger, + clock, + config.Expiration); }) .As(); } @@ -65,7 +68,9 @@ public static class NitrideTemporalBuilderExtensions Timekeeper timekeeper = scope.Resolve(); timekeeper.DateTimeZone = config.DateTimeZone; - logger.Verbose("Setting time zone to {Zone:l}", timekeeper.DateTimeZone); + logger.Verbose( + "Setting time zone to {Zone:l}", + timekeeper.DateTimeZone); }); } diff --git a/src/MfGames.Nitride.Temporal/NitrideTemporalConfiguration.cs b/src/MfGames.Nitride.Temporal/NitrideTemporalConfiguration.cs index 6b73058..2d42c56 100644 --- a/src/MfGames.Nitride.Temporal/NitrideTemporalConfiguration.cs +++ b/src/MfGames.Nitride.Temporal/NitrideTemporalConfiguration.cs @@ -44,7 +44,8 @@ public partial class NitrideTemporalConfiguration /// such /// as "500000:00:00.0". /// - public NitrideTemporalConfiguration WithExpiresCommandLineOption(TimeSpan? timeSpan) + public NitrideTemporalConfiguration WithExpiresCommandLineOption( + TimeSpan? timeSpan) { return this.WithExpiresCommandLineOption(timeSpan?.ToString()); } @@ -54,7 +55,8 @@ public partial class NitrideTemporalConfiguration /// "XXX" is a format like "5y" or "500000:00:00.0". This is parsed by /// TimeSpanParser which gives an easy format. /// - public NitrideTemporalConfiguration WithExpiresCommandLineOption(string? defaultValue) + public NitrideTemporalConfiguration WithExpiresCommandLineOption( + string? defaultValue) { this.AddExpireOptionToCommandLine = defaultValue != null; this.Expiration = defaultValue; diff --git a/src/MfGames.Nitride.Temporal/SetInstantFromComponent.cs b/src/MfGames.Nitride.Temporal/SetInstantFromComponent.cs index 106f7d2..9e31a98 100644 --- a/src/MfGames.Nitride.Temporal/SetInstantFromComponent.cs +++ b/src/MfGames.Nitride.Temporal/SetInstantFromComponent.cs @@ -50,7 +50,8 @@ public class SetInstantFromComponent : OperationBase /// into an Instant automatically. This can handle DateTime, /// DateTimeOffset, LocalDate, and Instant. Nulls are skipped. /// - public SetInstantFromComponent WithGetDateTimeObject(Func? callback) + public SetInstantFromComponent WithGetDateTimeObject( + Func? callback) { this.GetDateTimeObject = callback; diff --git a/src/MfGames.Nitride.Temporal/SetInstantFromComponentValidator.cs b/src/MfGames.Nitride.Temporal/SetInstantFromComponentValidator.cs index 33548c0..afd40e0 100644 --- a/src/MfGames.Nitride.Temporal/SetInstantFromComponentValidator.cs +++ b/src/MfGames.Nitride.Temporal/SetInstantFromComponentValidator.cs @@ -2,7 +2,8 @@ using FluentValidation; namespace MfGames.Nitride.Temporal; -public class SetInstantFromComponentValidator : AbstractValidator> +public class SetInstantFromComponentValidator + : AbstractValidator> { public SetInstantFromComponentValidator() { diff --git a/src/MfGames.Nitride.Temporal/SetInstantFromPath.cs b/src/MfGames.Nitride.Temporal/SetInstantFromPath.cs index 9650e33..14a5572 100644 --- a/src/MfGames.Nitride.Temporal/SetInstantFromPath.cs +++ b/src/MfGames.Nitride.Temporal/SetInstantFromPath.cs @@ -31,7 +31,8 @@ public partial class SetInstantFromPath : OperationBase { this.validator = validator; this.clock = clock; - this.PathRegex = new Regex(@"(?\d{4})[/-](?\d{2})[/-](?\d{2})"); + this.PathRegex = new Regex( + @"(?\d{4})[/-](?\d{2})[/-](?\d{2})"); } /// diff --git a/src/MfGames.Nitride.Yaml/MfGames.Nitride.Yaml.csproj b/src/MfGames.Nitride.Yaml/MfGames.Nitride.Yaml.csproj index 1093a94..6efc5cd 100644 --- a/src/MfGames.Nitride.Yaml/MfGames.Nitride.Yaml.csproj +++ b/src/MfGames.Nitride.Yaml/MfGames.Nitride.Yaml.csproj @@ -10,12 +10,12 @@ - + - - + + diff --git a/src/MfGames.Nitride.Yaml/NitrideYamlBuilderExtensions.cs b/src/MfGames.Nitride.Yaml/NitrideYamlBuilderExtensions.cs index 8305cb7..87cb05e 100644 --- a/src/MfGames.Nitride.Yaml/NitrideYamlBuilderExtensions.cs +++ b/src/MfGames.Nitride.Yaml/NitrideYamlBuilderExtensions.cs @@ -6,6 +6,7 @@ public static class NitrideYamlBuilderExtensions { public static NitrideBuilder UseYaml(this NitrideBuilder builder) { - return builder.ConfigureContainer(x => x.RegisterModule()); + return builder.ConfigureContainer( + x => x.RegisterModule()); } } diff --git a/src/MfGames.Nitride.Yaml/NitrideYamlEntityExtensions.cs b/src/MfGames.Nitride.Yaml/NitrideYamlEntityExtensions.cs index 918d2c6..36fba44 100644 --- a/src/MfGames.Nitride.Yaml/NitrideYamlEntityExtensions.cs +++ b/src/MfGames.Nitride.Yaml/NitrideYamlEntityExtensions.cs @@ -1,7 +1,6 @@ using System; using MfGames.Gallium; - using MfGames.Nitride.Contents; using YamlDotNet.Serialization; diff --git a/src/MfGames.Nitride.Yaml/ParseYamlHeader.cs b/src/MfGames.Nitride.Yaml/ParseYamlHeader.cs index e2b34f6..cb6a850 100644 --- a/src/MfGames.Nitride.Yaml/ParseYamlHeader.cs +++ b/src/MfGames.Nitride.Yaml/ParseYamlHeader.cs @@ -4,7 +4,6 @@ using System.IO; using System.Text; using MfGames.Gallium; - using MfGames.Nitride.Contents; using YamlDotNet.Serialization; @@ -31,7 +30,8 @@ public class ParseYamlHeader : OperationBase this.RemoveHeader = true; } - public Func? EntityError { get; set; } + public Func? + EntityError { get; set; } /// /// Gets or sets a value indicating whether the header should be removed @@ -43,7 +43,9 @@ public class ParseYamlHeader : OperationBase public override IEnumerable Run(IEnumerable input) { // Set up the YAML parsing. - DeserializerBuilder builder = new DeserializerBuilder().WithNamingConvention(this.namingConvention); + DeserializerBuilder builder = + new DeserializerBuilder().WithNamingConvention( + this.namingConvention); if (this.ignoreUnmatchedProperties) { @@ -62,7 +64,8 @@ public class ParseYamlHeader : OperationBase content) => this.Parse(entity, content, deserializer)); } - public ParseYamlHeader WithEntityError(Func? value) + public ParseYamlHeader WithEntityError( + Func? value) { this.EntityError = value; @@ -157,7 +160,8 @@ public class ParseYamlHeader : OperationBase } catch (Exception exception) { - ParseYamlHeaderErrorHandling disposition = this.EntityError?.Invoke(entity, yaml, exception) + ParseYamlHeaderErrorHandling disposition = + this.EntityError?.Invoke(entity, yaml, exception) ?? ParseYamlHeaderErrorHandling.Throw; if (disposition == ParseYamlHeaderErrorHandling.Ignore) diff --git a/src/MfGames.Nitride/Commands/BuildCommand.cs b/src/MfGames.Nitride/Commands/BuildCommand.cs index 04511ac..c370af2 100644 --- a/src/MfGames.Nitride/Commands/BuildCommand.cs +++ b/src/MfGames.Nitride/Commands/BuildCommand.cs @@ -49,7 +49,9 @@ public class BuildCommand : Command, ICommandHandler public async Task InvokeAsync(InvocationContext context) { // Process any injected options. - this.logger.Debug("Processing {Count:N0} pipeline options", this.pipelineOptions.Count); + this.logger.Debug( + "Processing {Count:N0} pipeline options", + this.pipelineOptions.Count); foreach (IPipelineCommandOption? option in this.pipelineOptions) { diff --git a/src/MfGames.Nitride/Contents/FileBinaryContent.cs b/src/MfGames.Nitride/Contents/FileBinaryContent.cs index 85520a8..3db8f14 100644 --- a/src/MfGames.Nitride/Contents/FileBinaryContent.cs +++ b/src/MfGames.Nitride/Contents/FileBinaryContent.cs @@ -28,7 +28,11 @@ public class FileBinaryContent : IBinaryContent, ITextContentConvertable /// public Stream GetStream() { - return File.Open(this.path, FileMode.Open, FileAccess.Read, FileShare.Read); + return File.Open( + this.path, + FileMode.Open, + FileAccess.Read, + FileShare.Read); } /// diff --git a/src/MfGames.Nitride/Contents/FileTextContent.cs b/src/MfGames.Nitride/Contents/FileTextContent.cs index 143bfa1..8952e07 100644 --- a/src/MfGames.Nitride/Contents/FileTextContent.cs +++ b/src/MfGames.Nitride/Contents/FileTextContent.cs @@ -29,7 +29,13 @@ public class FileTextContent : ITextContent, IBinaryContentConvertable /// public TextReader GetReader() { - return new StreamReader(File.Open(this.path, FileMode.Open, FileAccess.Read, FileShare.Read), Encoding.UTF8); + return new StreamReader( + File.Open( + this.path, + FileMode.Open, + FileAccess.Read, + FileShare.Read), + Encoding.UTF8); } /// diff --git a/src/MfGames.Nitride/Entities/CreateOrUpdateIndex.cs b/src/MfGames.Nitride/Entities/CreateOrUpdateIndex.cs index 5653130..10bc565 100644 --- a/src/MfGames.Nitride/Entities/CreateOrUpdateIndex.cs +++ b/src/MfGames.Nitride/Entities/CreateOrUpdateIndex.cs @@ -41,7 +41,8 @@ public partial class CreateOrUpdateIndex : OperationBase /// index that has been already created. If this is null, no new indexes /// will be made. /// - public Func, Entity>? CreateIndex { get; set; } = null!; + public Func, Entity>? CreateIndex { get; set; } = + null!; /// /// Gets or sets the function to retrieve the key from an existing @@ -58,7 +59,11 @@ public partial class CreateOrUpdateIndex : OperationBase /// /// Updates an existing index entity to include new information. /// - public Func, Entity> UpdateIndex { get; set; } = null!; + public Func, Entity> UpdateIndex + { + get; + set; + } = null!; /// public override IEnumerable Run(IEnumerable input) @@ -89,7 +94,9 @@ public partial class CreateOrUpdateIndex : OperationBase { // This is an existing entity page that needs to be updated. IEnumerable entries = - scanned.TryGetValue(key, out List? list) ? list : Array.Empty(); + scanned.TryGetValue(key, out List? list) + ? list + : Array.Empty(); existing.Add(key); @@ -100,7 +107,8 @@ public partial class CreateOrUpdateIndex : OperationBase // Once we're done with the list, we need to create the missing indexes. if (this.CreateIndex != null) { - foreach (string key in scanned.Keys.Where(key => !existing.Contains(key))) + foreach (string key in scanned.Keys.Where( + key => !existing.Contains(key))) { yield return this.CreateIndex(key, scanned[key]); } diff --git a/src/MfGames.Nitride/Entities/CreateOrUpdateIndexValidator.cs b/src/MfGames.Nitride/Entities/CreateOrUpdateIndexValidator.cs index 0f38af9..4f6ee84 100644 --- a/src/MfGames.Nitride/Entities/CreateOrUpdateIndexValidator.cs +++ b/src/MfGames.Nitride/Entities/CreateOrUpdateIndexValidator.cs @@ -2,7 +2,8 @@ using FluentValidation; namespace MfGames.Nitride.Entities; -public class CreateOrUpdateIndexValidator : AbstractValidator +public class CreateOrUpdateIndexValidator + : AbstractValidator { public CreateOrUpdateIndexValidator() { diff --git a/src/MfGames.Nitride/Entities/EntityScanner.cs b/src/MfGames.Nitride/Entities/EntityScanner.cs index 2120350..d2e8b61 100644 --- a/src/MfGames.Nitride/Entities/EntityScanner.cs +++ b/src/MfGames.Nitride/Entities/EntityScanner.cs @@ -39,7 +39,8 @@ public partial class EntityScanner : OperationBase /// Gets or sets a callback function that gets the keys associated with /// the given entity. /// - public Func?> GetKeysFromEntity { get; set; } = null!; + public Func?> GetKeysFromEntity { get; set; } = + null!; /// /// Gets the list of entities associated with the given key. if the key has not @@ -106,7 +107,8 @@ public partial class EntityScanner : OperationBase { // Scan the given entity and see where it needs to be included. // The entity is added to each of the keys returned by this class. - IEnumerable? keysFromEntity = this.GetKeysFromEntity(entity); + IEnumerable? keysFromEntity = + this.GetKeysFromEntity(entity); if (keysFromEntity != null) { diff --git a/src/MfGames.Nitride/Entities/EntitySequence.cs b/src/MfGames.Nitride/Entities/EntitySequence.cs index 45ec6bf..f2d4320 100644 --- a/src/MfGames.Nitride/Entities/EntitySequence.cs +++ b/src/MfGames.Nitride/Entities/EntitySequence.cs @@ -25,11 +25,13 @@ public class EntitySequence public bool IsFirst => this.Sequence.Count > 0 && this.Index == 0; - public bool IsLast => this.Sequence.Count > 0 && this.Index == this.Sequence.Count - 1; + public bool IsLast => this.Sequence.Count > 0 + && this.Index == this.Sequence.Count - 1; public Entity? Next => this.HasNext ? this.Sequence[this.Index + 1] : null; - public Entity? Previous => this.HasPrevious ? this.Sequence[this.Index - 1] : null; + public Entity? Previous => + this.HasPrevious ? this.Sequence[this.Index - 1] : null; public IReadOnlyList Sequence { get; } } diff --git a/src/MfGames.Nitride/Entities/LinkEntitySequence.cs b/src/MfGames.Nitride/Entities/LinkEntitySequence.cs index b7cfd5f..d589174 100644 --- a/src/MfGames.Nitride/Entities/LinkEntitySequence.cs +++ b/src/MfGames.Nitride/Entities/LinkEntitySequence.cs @@ -38,7 +38,11 @@ public partial class LinkEntitySequence : OperationBase, IResolvingOperation /// /// Gets or sets the function used to create the sequence index. /// - public Func, int, EntitySequence> CreateSequenceIndex { get; set; } + public Func, int, EntitySequence> CreateSequenceIndex + { + get; + set; + } /// public override IEnumerable Run(IEnumerable input) @@ -56,7 +60,9 @@ public partial class LinkEntitySequence : OperationBase, IResolvingOperation for (int i = 0; i < list.Count; i++) { Entity entity = list[i]; - EntitySequence index = this.CreateSequenceIndex(list.AsReadOnly(), i); + EntitySequence index = this.CreateSequenceIndex( + list.AsReadOnly(), + i); yield return this.AddSequenceIndex(entity, index); } diff --git a/src/MfGames.Nitride/ExpressionHelper.cs b/src/MfGames.Nitride/ExpressionHelper.cs index d1b84cc..c3f1614 100644 --- a/src/MfGames.Nitride/ExpressionHelper.cs +++ b/src/MfGames.Nitride/ExpressionHelper.cs @@ -10,12 +10,14 @@ namespace MfGames.Nitride; /// public static class ExpressionHelper { - public static string GetMemberName(Expression> expression) + public static string GetMemberName( + Expression> expression) { return GetMemberName(expression.Body); } - public static IEnumerable GetMemberNames(params Expression>[] expressions) + public static IEnumerable GetMemberNames( + params Expression>[] expressions) { return expressions.Select(x => GetMemberName(x.Body)); } @@ -54,7 +56,8 @@ public static class ExpressionHelper private static string GetMemberName(UnaryExpression unaryExpression) { - if (unaryExpression.Operand is MethodCallExpression methodCallExpression) + if (unaryExpression.Operand is MethodCallExpression + methodCallExpression) { return methodCallExpression.Method.Name; } diff --git a/src/MfGames.Nitride/MfGames.Nitride.csproj b/src/MfGames.Nitride/MfGames.Nitride.csproj index d3d2ff1..e643ef3 100644 --- a/src/MfGames.Nitride/MfGames.Nitride.csproj +++ b/src/MfGames.Nitride/MfGames.Nitride.csproj @@ -15,22 +15,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/src/MfGames.Nitride/NitrideBuilder.cs b/src/MfGames.Nitride/NitrideBuilder.cs index 044698a..e789a10 100644 --- a/src/MfGames.Nitride/NitrideBuilder.cs +++ b/src/MfGames.Nitride/NitrideBuilder.cs @@ -32,14 +32,16 @@ public class NitrideBuilder /// An event that is called after the container is built but before /// the application runs. /// - private readonly List> configureSiteCallbacks; + private readonly List> + configureSiteCallbacks; private readonly NitrideModule nitrideModule; public NitrideBuilder(string[] arguments) { this.arguments = arguments; - this.configureSiteCallbacks = new List>(); + this.configureSiteCallbacks = + new List>(); this.configureContainerCallbacks = new List>(); this.nitrideModule = new NitrideModule(); @@ -74,7 +76,8 @@ public class NitrideBuilder /// /// The callback to register. /// The builder for chaining. - public NitrideBuilder ConfigureSite(Action callback) + public NitrideBuilder ConfigureSite( + Action callback) { this.configureSiteCallbacks.Add(callback); @@ -173,12 +176,14 @@ public class NitrideBuilder this.RegisterRootDirectory(Log.Logger, builder); // Finish up the registration by running our events. - foreach (Action? callback in this.configureSiteCallbacks) + foreach (Action? callback in this + .configureSiteCallbacks) { builder.RegisterBuildCallback(scope => callback(this, scope)); } - foreach (Action? configureContainer in this.configureContainerCallbacks) + foreach (Action? configureContainer in this + .configureContainerCallbacks) { configureContainer.Invoke(builder); } @@ -195,10 +200,14 @@ public class NitrideBuilder return; } - logger.Debug("Setting root directory to {Path}", this.RootDirectory.FullName); + logger.Debug( + "Setting root directory to {Path}", + this.RootDirectory.FullName); var rootFileSystem = new PhysicalFileSystem(); - var subFileSystem = new SubFileSystem(rootFileSystem, this.RootDirectory.FullName); + var subFileSystem = new SubFileSystem( + rootFileSystem, + this.RootDirectory.FullName); builder.RegisterInstance(subFileSystem) .As() diff --git a/src/MfGames.Nitride/NitrideModule.cs b/src/MfGames.Nitride/NitrideModule.cs index a355ba9..d1a2fb5 100644 --- a/src/MfGames.Nitride/NitrideModule.cs +++ b/src/MfGames.Nitride/NitrideModule.cs @@ -59,7 +59,8 @@ public class NitrideModule : Module ; // Add in the commands. - IEnumerable commands = c.Resolve>(); + IEnumerable commands = + c.Resolve>(); foreach (Command command in commands) { diff --git a/src/MfGames.Nitride/Pipelines/IPipeline.cs b/src/MfGames.Nitride/Pipelines/IPipeline.cs index 8943bca..c664787 100644 --- a/src/MfGames.Nitride/Pipelines/IPipeline.cs +++ b/src/MfGames.Nitride/Pipelines/IPipeline.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Threading.Tasks; using MfGames.Gallium; diff --git a/src/MfGames.Nitride/Pipelines/PipelineBase.cs b/src/MfGames.Nitride/Pipelines/PipelineBase.cs index 38569f2..1bf5f30 100644 --- a/src/MfGames.Nitride/Pipelines/PipelineBase.cs +++ b/src/MfGames.Nitride/Pipelines/PipelineBase.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Threading.Tasks; using MfGames.Gallium; @@ -31,7 +30,8 @@ public abstract class PipelineBase : IPipeline } /// - public abstract IAsyncEnumerable RunAsync(IEnumerable entities); + public abstract IAsyncEnumerable RunAsync( + IEnumerable entities); /// public override string ToString() diff --git a/src/MfGames.Nitride/Pipelines/PipelineManager.cs b/src/MfGames.Nitride/Pipelines/PipelineManager.cs index 4f41a33..9a145ba 100644 --- a/src/MfGames.Nitride/Pipelines/PipelineManager.cs +++ b/src/MfGames.Nitride/Pipelines/PipelineManager.cs @@ -40,7 +40,8 @@ public class PipelineManager public ICollection Pipelines { get => this.pipelines; - set => this.pipelines = value ?? throw new ArgumentNullException(nameof(value)); + set => this.pipelines = + value ?? throw new ArgumentNullException(nameof(value)); } /// @@ -60,9 +61,12 @@ public class PipelineManager // Go through all the entries and start each one. We gather the // resulting tasks and then wait for all of them to end. - this.logger.Verbose("Starting {Count:l}", "pipeline".ToQuantity(this.pipelines.Count)); + this.logger.Verbose( + "Starting {Count:l}", + "pipeline".ToQuantity(this.pipelines.Count)); - Task[] tasks = this.entries.Select(x => Task.Run(async () => await x.RunAsync())) + Task[] tasks = this.entries + .Select(x => Task.Run(async () => await x.RunAsync())) .ToArray(); var report = TimeSpan.FromSeconds(15); @@ -72,13 +76,17 @@ public class PipelineManager var waiting = this.entries.Where(x => !x.IsFinished) .ToList(); - this.logger.Debug("Waiting for {Count:l} to finish running", "pipeline".ToQuantity(waiting.Count)); + this.logger.Debug( + "Waiting for {Count:l} to finish running", + "pipeline".ToQuantity(waiting.Count)); - IOrderedEnumerable> states = - waiting.GroupBy(x => x.State, x => x) - .OrderBy(x => (int)x.Key); + IOrderedEnumerable> + states = + waiting.GroupBy(x => x.State, x => x) + .OrderBy(x => (int)x.Key); - foreach (IGrouping? state in states) + foreach (IGrouping? state in + states) { var statePipelines = state.OrderBy(x => x.Pipeline.ToString()) .ToList(); @@ -90,15 +98,20 @@ public class PipelineManager string.Join( ", ", state.Key == PipelineRunnerState.Started - ? statePipelines.Select(x => $"{x.Pipeline} ({x.ElapsedFromState})") - : statePipelines.Select(x => x.Pipeline.ToString()))); + ? statePipelines.Select( + x => $"{x.Pipeline} ({x.ElapsedFromState})") + : statePipelines.Select( + x => x.Pipeline.ToString()))); } } // Figure out our return code. - bool hasErrors = this.entries.Any(x => x.State == PipelineRunnerState.Errored); + bool hasErrors = + this.entries.Any(x => x.State == PipelineRunnerState.Errored); - this.logger.Information("Completed in {Elapsed}", DateTime.UtcNow - started); + this.logger.Information( + "Completed in {Elapsed}", + DateTime.UtcNow - started); return Task.FromResult(hasErrors ? 2 : 0); } @@ -119,12 +132,15 @@ public class PipelineManager if (this.pipelines.Count == 0) { this.logger.Error( - "There are no registered pipelines run, use" + " ConfigureContainer to include IPipeline instances"); + "There are no registered pipelines run, use" + + " ConfigureContainer to include IPipeline instances"); return false; } - this.logger.Verbose("Setting up {Count:l}", "pipeline".ToQuantity(this.pipelines.Count)); + this.logger.Verbose( + "Setting up {Count:l}", + "pipeline".ToQuantity(this.pipelines.Count)); // Wrap all the pipelines into entries. We do this before the next // step so we can have the entries depend on the entries. @@ -140,7 +156,8 @@ public class PipelineManager foreach (IPipeline? dependency in dependencies) { // Get the entry for the dependency. - PipelineRunner dependencyPipeline = this.entries.Single(x => x.Pipeline == dependency); + PipelineRunner dependencyPipeline = + this.entries.Single(x => x.Pipeline == dependency); // Set up the bi-directional connection. entry.Incoming.Add(dependencyPipeline); diff --git a/src/MfGames.Nitride/Pipelines/PipelineRunner.cs b/src/MfGames.Nitride/Pipelines/PipelineRunner.cs index eb9c8b3..e7350cb 100644 --- a/src/MfGames.Nitride/Pipelines/PipelineRunner.cs +++ b/src/MfGames.Nitride/Pipelines/PipelineRunner.cs @@ -4,10 +4,10 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -using MfGames.Gallium; - using Humanizer; +using MfGames.Gallium; + using Serilog; namespace MfGames.Nitride.Pipelines; @@ -50,7 +50,8 @@ public class PipelineRunner ILogger logger, IPipeline pipeline) { - this.Pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + this.Pipeline = + pipeline ?? throw new ArgumentNullException(nameof(pipeline)); this.Incoming = new List(); this.Outgoing = new List(); this.Outputs = new List(); @@ -84,7 +85,8 @@ public class PipelineRunner /// /// Gets a value indicating whether this pipeline is done running. /// - public bool IsFinished => this.State is PipelineRunnerState.Finalized or PipelineRunnerState.Errored; + public bool IsFinished => this.State is PipelineRunnerState.Finalized + or PipelineRunnerState.Errored; /// /// Gets a value indicating whether this entry is a starting one @@ -123,7 +125,10 @@ public class PipelineRunner { int current = Interlocked.Decrement(ref this.waitingOnConsumers); - this.logger.Verbose("{Pipeline:l}: Consumer signalled, waiting for {Count:n0}", this.Pipeline, current); + this.logger.Verbose( + "{Pipeline:l}: Consumer signalled, waiting for {Count:n0}", + this.Pipeline, + current); if (current == 0) { @@ -205,7 +210,10 @@ public class PipelineRunner catch (Exception exception) { // Report the exception. - this.logger.Error(exception, "{Pipeline:l}: There was an exception running pipeline", this.Pipeline); + this.logger.Error( + exception, + "{Pipeline:l}: There was an exception running pipeline", + this.Pipeline); // Change our state and then release any pipeline waiting for us // so they can pick up the error and fail themselves. @@ -287,7 +295,9 @@ public class PipelineRunner } // Make sure our internal wait for the consumers it set. - this.logger.Verbose("{Pipeline:l}: Setting up internal thread controls", this.Pipeline); + this.logger.Verbose( + "{Pipeline:l}: Setting up internal thread controls", + this.Pipeline); this.waitingOnConsumers = this.Outgoing.Count; this.consumersDone.Reset(); @@ -300,7 +310,9 @@ public class PipelineRunner // Release our manual reset to allow operations to continue. this.ChangeState(PipelineRunnerState.Providing); - this.logger.Verbose("{Pipeline:l}: Release manual reset for consumers", this.Pipeline); + this.logger.Verbose( + "{Pipeline:l}: Release manual reset for consumers", + this.Pipeline); this.blockDependencies.Set(); // Wait until all consumers have finished processing. @@ -316,7 +328,10 @@ public class PipelineRunner this.signaledDoneWithInputs = true; - this.logger.Debug("{Pipeline:l}: Signaling {Count:n0} dependencies done", this.Pipeline, this.Incoming.Count); + this.logger.Debug( + "{Pipeline:l}: Signaling {Count:n0} dependencies done", + this.Pipeline, + this.Incoming.Count); foreach (PipelineRunner? dependency in this.Incoming) { @@ -346,14 +361,17 @@ public class PipelineRunner // Check for any error state in the dependency, if we have one, // then we need to stop ourselves. - bool hasError = this.Incoming.Any(x => x.State == PipelineRunnerState.Errored); + bool hasError = + this.Incoming.Any(x => x.State == PipelineRunnerState.Errored); if (!hasError) { return false; } - this.logger.Error("{Pipeline:l}: There was an exception in an dependency", this.Pipeline); + this.logger.Error( + "{Pipeline:l}: There was an exception in an dependency", + this.Pipeline); this.ChangeState(PipelineRunnerState.Errored); this.blockDependencies.Set(); diff --git a/src/MfGames.Nitride/Pipelines/README.md b/src/MfGames.Nitride/Pipelines/README.md index b05e437..7469710 100644 --- a/src/MfGames.Nitride/Pipelines/README.md +++ b/src/MfGames.Nitride/Pipelines/README.md @@ -16,7 +16,7 @@ A pipeline implements the `IPipeline` interface or extends the convenience class `Pipeline`. ```c# -using Nitride.Pipelines; +using MfGames.Nitride.Pipelines; public class LoadFilesPipeline : Pipeline {} ``` diff --git a/src/MfGames.Nitride/ROADMAP.md b/src/MfGames.Nitride/ROADMAP.md index 0d8e157..b5b2761 100644 --- a/src/MfGames.Nitride/ROADMAP.md +++ b/src/MfGames.Nitride/ROADMAP.md @@ -2,8 +2,8 @@ ## Immediate -- Switch the various operations to be async - - ReadFiles - - WriteFiles -- Implement mime type determination -- Implement a convert to text content based on mime type +- Switch the various operations to be async + - ReadFiles + - WriteFiles +- Implement mime type determination +- Implement a convert to text content based on mime type diff --git a/tests/MfGames.Nitride.IO.Tests/MfGames.Nitride.IO.Tests.csproj b/tests/MfGames.Nitride.IO.Tests/MfGames.Nitride.IO.Tests.csproj index 2b304f5..8c1fde0 100644 --- a/tests/MfGames.Nitride.IO.Tests/MfGames.Nitride.IO.Tests.csproj +++ b/tests/MfGames.Nitride.IO.Tests/MfGames.Nitride.IO.Tests.csproj @@ -6,22 +6,22 @@ - - + + - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/tests/MfGames.Nitride.IO.Tests/Paths/AddPathPrefixTest.cs b/tests/MfGames.Nitride.IO.Tests/Paths/AddPathPrefixTest.cs index f65af7f..88fca81 100644 --- a/tests/MfGames.Nitride.IO.Tests/Paths/AddPathPrefixTest.cs +++ b/tests/MfGames.Nitride.IO.Tests/Paths/AddPathPrefixTest.cs @@ -8,7 +8,7 @@ using Xunit.Abstractions; using Zio; -namespace MfGames.Nitride.IO.Tests; +namespace MfGames.Nitride.IO.Tests.Paths; public class AddPathPrefixTest : NitrideIOTestBase { @@ -36,9 +36,10 @@ public class AddPathPrefixTest : NitrideIOTestBase .WithPathPrefix("/prefix"); // Read and replace the paths. - IOrderedEnumerable output = readFiles.WithPattern("/**") - .Run() - .Run(op) + IOrderedEnumerable output = NitrideOperationExtensions.Run( + readFiles.WithPattern("/**") + .Run(), + op) .Select( x => x.Get() .ToString()) diff --git a/tests/MfGames.Nitride.IO.Tests/Paths/DirectChildPathScannerTests.cs b/tests/MfGames.Nitride.IO.Tests/Paths/DirectChildPathScannerTests.cs index 0283635..89023e9 100644 --- a/tests/MfGames.Nitride.IO.Tests/Paths/DirectChildPathScannerTests.cs +++ b/tests/MfGames.Nitride.IO.Tests/Paths/DirectChildPathScannerTests.cs @@ -10,7 +10,7 @@ using Xunit.Abstractions; using Zio; -namespace MfGames.Nitride.IO.Tests; +namespace MfGames.Nitride.IO.Tests.Paths; public class DirectChildPathScannerTests : NitrideIOTestBase { @@ -45,9 +45,10 @@ public class DirectChildPathScannerTests : NitrideIOTestBase DirectChildPathScanner op = context.Resolve(); // Read and replace the paths. - var _ = readFiles.WithPattern("/**") - .Run() - .Run(op) + var _ = NitrideOperationExtensions.Run( + readFiles.WithPattern("/**") + .Run(), + op) .ToList(); KeyValuePair[] actual = op.GetScannedResults() @@ -64,9 +65,15 @@ public class DirectChildPathScannerTests : NitrideIOTestBase // Verify the results. KeyValuePair[] expected = new[] { - new KeyValuePair("/", new[] { "/a/index.md", "/b/index.md" }), - new KeyValuePair("/a/", new[] { "/a/c/index.md", "/a/d/index.md" }), - new KeyValuePair("/a/d/", new[] { "/a/d/e/index.md" }), + new KeyValuePair( + "/", + new[] { "/a/index.md", "/b/index.md" }), + new KeyValuePair( + "/a/", + new[] { "/a/c/index.md", "/a/d/index.md" }), + new KeyValuePair( + "/a/d/", + new[] { "/a/d/e/index.md" }), }; TestHelper.CompareObjects(expected, actual); diff --git a/tests/MfGames.Nitride.IO.Tests/Paths/GetEntityByPathTests.cs b/tests/MfGames.Nitride.IO.Tests/Paths/GetEntityByPathTests.cs index d47a6db..97c5f37 100644 --- a/tests/MfGames.Nitride.IO.Tests/Paths/GetEntityByPathTests.cs +++ b/tests/MfGames.Nitride.IO.Tests/Paths/GetEntityByPathTests.cs @@ -1,7 +1,7 @@ +using System.Collections.Generic; using System.Linq; using MfGames.Gallium; - using MfGames.Nitride.IO.Contents; using Xunit; @@ -9,7 +9,7 @@ using Xunit.Abstractions; using Zio; -namespace MfGames.Nitride.IO.Tests; +namespace MfGames.Nitride.IO.Tests.Paths; public class GetEntityByPathTests : NitrideIOTestBase { @@ -34,9 +34,12 @@ public class GetEntityByPathTests : NitrideIOTestBase ReadFiles readFiles = context.Resolve(); // Read and replace the paths. - IOrderedEnumerable output = readFiles.WithPattern("/**") - .Run() - .GetEntityByPath("/c1.md", out Entity? found) + IOrderedEnumerable output = NitrideIOEnumerableEntityExtensions + .GetEntityByPath( + readFiles.WithPattern("/**") + .Run(), + "/c1.md", + out Entity? found) .Select( x => x.Get() .ToString()) @@ -70,9 +73,13 @@ public class GetEntityByPathTests : NitrideIOTestBase ReadFiles readFiles = context.Resolve(); // Read and replace the paths. - IOrderedEnumerable output = readFiles.WithPattern("/**") - .Run() - .GetEntityByPath("/c1.md", out Entity? found, IfFoundOutput.ReturnInOutput) + IOrderedEnumerable output = NitrideIOEnumerableEntityExtensions + .GetEntityByPath( + (IEnumerable)readFiles.WithPattern("/**") + .Run(), + (UPath)"/c1.md", + out Entity? found, + (IfFoundOutput)IfFoundOutput.ReturnInOutput) .Select( x => x.Get() .ToString()) @@ -107,9 +114,12 @@ public class GetEntityByPathTests : NitrideIOTestBase ReadFiles readFiles = context.Resolve(); // Read and replace the paths. - IOrderedEnumerable output = readFiles.WithPattern("/**") - .Run() - .GetEntityByPath("/not-found.md", out Entity? found) + IOrderedEnumerable output = NitrideIOEnumerableEntityExtensions + .GetEntityByPath( + readFiles.WithPattern("/**") + .Run(), + "/not-found.md", + out Entity? found) .Select( x => x.Get() .ToString()) diff --git a/tests/MfGames.Nitride.IO.Tests/Paths/LinkDirectChildrenTests.cs b/tests/MfGames.Nitride.IO.Tests/Paths/LinkDirectChildrenTests.cs index 2bf2d3e..e06fbd6 100644 --- a/tests/MfGames.Nitride.IO.Tests/Paths/LinkDirectChildrenTests.cs +++ b/tests/MfGames.Nitride.IO.Tests/Paths/LinkDirectChildrenTests.cs @@ -11,7 +11,7 @@ using Xunit.Abstractions; using Zio; -namespace MfGames.Nitride.IO.Tests; +namespace MfGames.Nitride.IO.Tests.Paths; public class LinkDirectChildrenTests : NitrideIOTestBase { @@ -43,15 +43,17 @@ public class LinkDirectChildrenTests : NitrideIOTestBase // Set up the operation. ReadFiles readFiles = context.Resolve(); - DirectChildPathScanner scanner = context.Resolve(); + DirectChildPathScanner scanner = + context.Resolve(); CreateOrUpdateIndex op = context.Resolve() .WithScanner(scanner); // Read and replace the paths. - Tuple[]? actual = readFiles.WithPattern("/**") - .Run() - .Run(scanner) + Tuple[]? actual = NitrideOperationExtensions.Run( + readFiles.WithPattern("/**") + .Run(), + scanner) .ToList() .Run(op) .Select( @@ -72,10 +74,16 @@ public class LinkDirectChildrenTests : NitrideIOTestBase { new Tuple("/a/c/index.md", new string[] { }), new Tuple("/a/d/e/index.md", new string[] { }), - new Tuple("/a/d/index.md", new[] { "/a/d/e/index.md" }), - new Tuple("/a/index.md", new[] { "/a/c/index.md", "/a/d/index.md" }), + new Tuple( + "/a/d/index.md", + new[] { "/a/d/e/index.md" }), + new Tuple( + "/a/index.md", + new[] { "/a/c/index.md", "/a/d/index.md" }), new Tuple("/b/index.md", new string[] { }), - new Tuple("/index.md", new[] { "/a/index.md", "/b/index.md" }), + new Tuple( + "/index.md", + new[] { "/a/index.md", "/b/index.md" }), }; TestHelper.CompareObjects(expected, actual); diff --git a/tests/MfGames.Nitride.IO.Tests/Paths/MoveToIndexPathsTest.cs b/tests/MfGames.Nitride.IO.Tests/Paths/MoveToIndexPathsTest.cs index 2f99b8c..f349484 100644 --- a/tests/MfGames.Nitride.IO.Tests/Paths/MoveToIndexPathsTest.cs +++ b/tests/MfGames.Nitride.IO.Tests/Paths/MoveToIndexPathsTest.cs @@ -8,7 +8,7 @@ using Xunit.Abstractions; using Zio; -namespace MfGames.Nitride.IO.Tests; +namespace MfGames.Nitride.IO.Tests.Paths; public class MoveToIndexPathsTest : NitrideIOTestBase { @@ -30,9 +30,10 @@ public class MoveToIndexPathsTest : NitrideIOTestBase MoveToIndexPath op = context.Resolve(); // Read and replace the paths. - IOrderedEnumerable output = readFiles.WithPattern("/**") - .Run() - .Run(op) + IOrderedEnumerable output = NitrideOperationExtensions.Run( + readFiles.WithPattern("/**") + .Run(), + op) .Select( x => x.Get() .ToString()) @@ -67,9 +68,10 @@ public class MoveToIndexPathsTest : NitrideIOTestBase .Contains("a1")); // Read and replace the paths. - IOrderedEnumerable output = readFiles.WithPattern("/**") - .Run() - .Run(op) + IOrderedEnumerable output = NitrideOperationExtensions.Run( + readFiles.WithPattern("/**") + .Run(), + op) .Select( x => x.Get() .ToString()) diff --git a/tests/MfGames.Nitride.IO.Tests/Paths/RemovePathPrefixTest.cs b/tests/MfGames.Nitride.IO.Tests/Paths/RemovePathPrefixTest.cs index caac344..1ed9388 100644 --- a/tests/MfGames.Nitride.IO.Tests/Paths/RemovePathPrefixTest.cs +++ b/tests/MfGames.Nitride.IO.Tests/Paths/RemovePathPrefixTest.cs @@ -8,7 +8,7 @@ using Xunit.Abstractions; using Zio; -namespace MfGames.Nitride.IO.Tests; +namespace MfGames.Nitride.IO.Tests.Paths; public class RemovePathPrefixTest : NitrideIOTestBase { @@ -38,9 +38,10 @@ public class RemovePathPrefixTest : NitrideIOTestBase .WithPathPrefix("/a"); // Read and replace the paths. - IOrderedEnumerable output = readFiles.WithPattern("/**") - .Run() - .Run(op) + IOrderedEnumerable output = NitrideOperationExtensions.Run( + readFiles.WithPattern("/**") + .Run(), + op) .Select( x => x.Get() .ToString()) diff --git a/tests/MfGames.Nitride.IO.Tests/Paths/WhereNotIgnoredTests.cs b/tests/MfGames.Nitride.IO.Tests/Paths/WhereNotIgnoredTests.cs index 370764e..b3c6dac 100644 --- a/tests/MfGames.Nitride.IO.Tests/Paths/WhereNotIgnoredTests.cs +++ b/tests/MfGames.Nitride.IO.Tests/Paths/WhereNotIgnoredTests.cs @@ -1,7 +1,9 @@ +using System.Collections.Generic; using System.Linq; using MAB.DotIgnore; +using MfGames.Gallium; using MfGames.Nitride.IO.Contents; using Xunit; @@ -9,7 +11,7 @@ using Xunit.Abstractions; using Zio; -namespace MfGames.Nitride.IO.Tests; +namespace MfGames.Nitride.IO.Tests.Paths; public class WhereNotIgnoredTests : NitrideIOTestBase { @@ -39,9 +41,11 @@ public class WhereNotIgnoredTests : NitrideIOTestBase ReadFiles readFiles = context.Resolve(); // Read and replace the paths. - IOrderedEnumerable output = readFiles.WithPattern("/**") - .Run() - .WhereNotIgnored(ignore) + IOrderedEnumerable output = NitrideIOEnumerableEntityExtensions + .WhereNotIgnored( + (IEnumerable)readFiles.WithPattern("/**") + .Run(), + ignore) .Select( x => x.Get() .ToString()) diff --git a/tests/MfGames.Nitride.IO.Tests/WriteFilesTest.cs b/tests/MfGames.Nitride.IO.Tests/WriteFilesTest.cs index da9085e..3824984 100644 --- a/tests/MfGames.Nitride.IO.Tests/WriteFilesTest.cs +++ b/tests/MfGames.Nitride.IO.Tests/WriteFilesTest.cs @@ -51,7 +51,9 @@ public class WriteFilesTest : NitrideIOTestBase .Run() .Select( x => x.Get() == "/b1/b.md" - ? x.SetTextContent(((ITextContentConvertable)x.GetBinaryContent()).ToTextContent()) + ? x.SetTextContent( + ((ITextContentConvertable)x.GetBinaryContent()) + .ToTextContent()) : x) .Run(op); diff --git a/tests/MfGames.Nitride.Markdown.Tests/MakeSingleLinkListItemsTests.cs b/tests/MfGames.Nitride.Markdown.Tests/MakeSingleLinkListItemsTests.cs index bfde40f..b2b0a4d 100644 --- a/tests/MfGames.Nitride.Markdown.Tests/MakeSingleLinkListItemsTests.cs +++ b/tests/MfGames.Nitride.Markdown.Tests/MakeSingleLinkListItemsTests.cs @@ -3,14 +3,12 @@ using System.Linq; using MfGames.Gallium; using MfGames.Nitride.Contents; -using MfGames.Nitride.Markdown; -using MfGames.Nitride.Tests; using MfGames.TestSetup; using Xunit; using Xunit.Abstractions; -namespace MfGames.Nitride.Slugs.Tests; +namespace MfGames.Nitride.Markdown.Tests; /// /// Tests the functionality of the WriteFiles(). diff --git a/tests/MfGames.Nitride.Markdown.Tests/MarkdownTestContext.cs b/tests/MfGames.Nitride.Markdown.Tests/MarkdownTestContext.cs index 1a706e3..66ca429 100644 --- a/tests/MfGames.Nitride.Markdown.Tests/MarkdownTestContext.cs +++ b/tests/MfGames.Nitride.Markdown.Tests/MarkdownTestContext.cs @@ -1,9 +1,9 @@ using Autofac; -using MfGames.Nitride.Markdown; +using MfGames.Nitride.Slugs; using MfGames.Nitride.Tests; -namespace MfGames.Nitride.Slugs.Tests; +namespace MfGames.Nitride.Markdown.Tests; public class MarkdownTestContext : NitrideTestContext { diff --git a/tests/MfGames.Nitride.Markdown.Tests/MfGames.Nitride.Markdown.Tests.csproj b/tests/MfGames.Nitride.Markdown.Tests/MfGames.Nitride.Markdown.Tests.csproj index 0efbd83..ae576c0 100644 --- a/tests/MfGames.Nitride.Markdown.Tests/MfGames.Nitride.Markdown.Tests.csproj +++ b/tests/MfGames.Nitride.Markdown.Tests/MfGames.Nitride.Markdown.Tests.csproj @@ -6,18 +6,18 @@ - - + + - - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/MfGames.Nitride.Slugs.Tests/MfGames.Nitride.Slugs.Tests.csproj b/tests/MfGames.Nitride.Slugs.Tests/MfGames.Nitride.Slugs.Tests.csproj index bfee31f..d8a072d 100644 --- a/tests/MfGames.Nitride.Slugs.Tests/MfGames.Nitride.Slugs.Tests.csproj +++ b/tests/MfGames.Nitride.Slugs.Tests/MfGames.Nitride.Slugs.Tests.csproj @@ -6,21 +6,21 @@ - - - + + + - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/tests/MfGames.Nitride.Temporal.Tests/CreateDateIndexesTests.cs b/tests/MfGames.Nitride.Temporal.Tests/CreateDateIndexesTests.cs index 4d5c246..b68b1be 100644 --- a/tests/MfGames.Nitride.Temporal.Tests/CreateDateIndexesTests.cs +++ b/tests/MfGames.Nitride.Temporal.Tests/CreateDateIndexesTests.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using MfGames.Gallium; - using MfGames.Nitride.Tests; using Xunit; @@ -38,13 +37,23 @@ public class CreateDateIndexesTests : TemporalTestBase .Add(timekeeper.CreateInstant(2022, 1, 2)), }; - List?, List?>> actual = this.GetActual(op, input); + List?, List?>> actual = + this.GetActual(op, input); var expected = new List?, List?>> { - new("index-2021-01", new List { "page1" }, new List()), - new("index-2021-02", new List { "page2" }, new List()), - new("index-2022-01", new List { "page3" }, new List()), + new( + "index-2021-01", + new List { "page1" }, + new List()), + new( + "index-2021-02", + new List { "page2" }, + new List()), + new( + "index-2022-01", + new List { "page3" }, + new List()), new("page1", null, null), new("page2", null, null), new("page3", null, null), @@ -73,18 +82,43 @@ public class CreateDateIndexesTests : TemporalTestBase .Add(timekeeper.CreateInstant(2022, 1, 2)), }; - List?, List?>> actual = this.GetActual(op, input); + List?, List?>> actual = + this.GetActual(op, input); var expected = new List?, List?>> { - new("index-2021", new List(), new List { "index-2021/01", "index-2021/02" }), - new("index-2021/01", new List(), new List { "index-2021/01/02" }), - new("index-2021/01/02", new List { "page1" }, new List()), - new("index-2021/02", new List(), new List { "index-2021/02/02" }), - new("index-2021/02/02", new List { "page2" }, new List()), - new("index-2022", new List(), new List { "index-2022/01" }), - new("index-2022/01", new List(), new List { "index-2022/01/02" }), - new("index-2022/01/02", new List { "page3" }, new List()), + new( + "index-2021", + new List(), + new List { "index-2021/01", "index-2021/02" }), + new( + "index-2021/01", + new List(), + new List { "index-2021/01/02" }), + new( + "index-2021/01/02", + new List { "page1" }, + new List()), + new( + "index-2021/02", + new List(), + new List { "index-2021/02/02" }), + new( + "index-2021/02/02", + new List { "page2" }, + new List()), + new( + "index-2022", + new List(), + new List { "index-2022/01" }), + new( + "index-2022/01", + new List(), + new List { "index-2022/01/02" }), + new( + "index-2022/01/02", + new List { "page3" }, + new List()), new("page1", null, null), new("page2", null, null), new("page3", null, null), @@ -114,18 +148,43 @@ public class CreateDateIndexesTests : TemporalTestBase .Add(timekeeper.CreateInstant(2022, 1, 2)), }; - List?, List?>> actual = this.GetActual(op, input); + List?, List?>> actual = + this.GetActual(op, input); var expected = new List?, List?>> { - new("index-2021", new List(), new List { "index-2021/01", "index-2021/02" }), - new("index-2021/01", new List { "page1" }, new List { "index-2021/01/02" }), - new("index-2021/01/02", new List { "page1" }, new List()), - new("index-2021/02", new List { "page2" }, new List { "index-2021/02/02" }), - new("index-2021/02/02", new List { "page2" }, new List()), - new("index-2022", new List { "page3" }, new List { "index-2022/01" }), - new("index-2022/01", new List { "page3" }, new List { "index-2022/01/02" }), - new("index-2022/01/02", new List { "page3" }, new List()), + new( + "index-2021", + new List(), + new List { "index-2021/01", "index-2021/02" }), + new( + "index-2021/01", + new List { "page1" }, + new List { "index-2021/01/02" }), + new( + "index-2021/01/02", + new List { "page1" }, + new List()), + new( + "index-2021/02", + new List { "page2" }, + new List { "index-2021/02/02" }), + new( + "index-2021/02/02", + new List { "page2" }, + new List()), + new( + "index-2022", + new List { "page3" }, + new List { "index-2022/01" }), + new( + "index-2022/01", + new List { "page3" }, + new List { "index-2022/01/02" }), + new( + "index-2022/01/02", + new List { "page3" }, + new List()), new("page1", null, null), new("page2", null, null), new("page3", null, null), @@ -154,15 +213,31 @@ public class CreateDateIndexesTests : TemporalTestBase .Add(timekeeper.CreateInstant(2022, 1, 2)), }; - List?, List?>> actual = this.GetActual(op, input); + List?, List?>> actual = + this.GetActual(op, input); var expected = new List?, List?>> { - new("index-2021", new List(), new List { "index-2021-01", "index-2021-02" }), - new("index-2021-01", new List { "page1" }, new List()), - new("index-2021-02", new List { "page2" }, new List()), - new("index-2022", new List(), new List { "index-2022-01" }), - new("index-2022-01", new List { "page3" }, new List()), + new( + "index-2021", + new List(), + new List { "index-2021-01", "index-2021-02" }), + new( + "index-2021-01", + new List { "page1" }, + new List()), + new( + "index-2021-02", + new List { "page2" }, + new List()), + new( + "index-2022", + new List(), + new List { "index-2022-01" }), + new( + "index-2022-01", + new List { "page3" }, + new List()), new("page1", null, null), new("page2", null, null), new("page3", null, null), @@ -191,11 +266,15 @@ public class CreateDateIndexesTests : TemporalTestBase .Add(timekeeper.CreateInstant(2022, 1, 2)), }; - List?, List?>> actual = this.GetActual(op, input); + List?, List?>> actual = + this.GetActual(op, input); var expected = new List?, List?>> { - new("index-2021", new List { "page1", "page2" }, new List()), + new( + "index-2021", + new List { "page1", "page2" }, + new List()), new("index-2022", new List { "page3" }, new List()), new("page1", null, null), new("page2", null, null), diff --git a/tests/MfGames.Nitride.Temporal.Tests/MfGames.Nitride.Temporal.Tests.csproj b/tests/MfGames.Nitride.Temporal.Tests/MfGames.Nitride.Temporal.Tests.csproj index c0c9c43..bd40748 100644 --- a/tests/MfGames.Nitride.Temporal.Tests/MfGames.Nitride.Temporal.Tests.csproj +++ b/tests/MfGames.Nitride.Temporal.Tests/MfGames.Nitride.Temporal.Tests.csproj @@ -6,17 +6,17 @@ - - + + - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/MfGames.Nitride.Tests/Entities/CreateOrUpdateIndexTests.cs b/tests/MfGames.Nitride.Tests/Entities/CreateOrUpdateIndexTests.cs index e7de209..7506990 100644 --- a/tests/MfGames.Nitride.Tests/Entities/CreateOrUpdateIndexTests.cs +++ b/tests/MfGames.Nitride.Tests/Entities/CreateOrUpdateIndexTests.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using MfGames.Gallium; - using MfGames.Nitride.Entities; using Xunit; @@ -65,8 +64,12 @@ public class CreateOrUpdateIndexTests : NitrideTestBase, IDisposable Assert.Equal( new[] { - new Tuple?>("index1", new List { "page1", "page3" }), - new Tuple?>("index2", new List { "page2" }), + new Tuple?>( + "index1", + new List { "page1", "page3" }), + new Tuple?>( + "index2", + new List { "page2" }), new Tuple?>("page1", null), new Tuple?>("page2", null), new Tuple?>("page3", null), @@ -92,8 +95,12 @@ public class CreateOrUpdateIndexTests : NitrideTestBase, IDisposable Assert.Equal( new[] { - new Tuple?>("index1", new List { "index2", "page3" }), - new Tuple?>("index2", new List { "page2" }), + new Tuple?>( + "index1", + new List { "index2", "page3" }), + new Tuple?>( + "index2", + new List { "page2" }), new Tuple?>("page2", null), new Tuple?>("page3", null), }, @@ -114,7 +121,9 @@ public class CreateOrUpdateIndexTests : NitrideTestBase, IDisposable Assert.Equal( new[] { - new Tuple?>("index1", new List { "page1" }), + new Tuple?>( + "index1", + new List { "page1" }), new Tuple?>("page1", null), }, actual); @@ -155,7 +164,9 @@ public class CreateOrUpdateIndexTests : NitrideTestBase, IDisposable Assert.Equal( new[] { - new Tuple?>("index1", new List { "page1" }), + new Tuple?>( + "index1", + new List { "page1" }), new Tuple?>("page1", null), }, actual); diff --git a/tests/MfGames.Nitride.Tests/Entities/LinkEntitySequenceTests.cs b/tests/MfGames.Nitride.Tests/Entities/LinkEntitySequenceTests.cs index 35d3970..4565553 100644 --- a/tests/MfGames.Nitride.Tests/Entities/LinkEntitySequenceTests.cs +++ b/tests/MfGames.Nitride.Tests/Entities/LinkEntitySequenceTests.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using MfGames.Gallium; - using MfGames.Nitride.Entities; using Xunit; diff --git a/tests/MfGames.Nitride.Tests/EntityContentTest.cs b/tests/MfGames.Nitride.Tests/EntityContentTest.cs index 472bd2f..ab8cecf 100644 --- a/tests/MfGames.Nitride.Tests/EntityContentTest.cs +++ b/tests/MfGames.Nitride.Tests/EntityContentTest.cs @@ -1,5 +1,4 @@ using MfGames.Gallium; - using MfGames.Nitride.Contents; using Xunit; diff --git a/tests/MfGames.Nitride.Tests/MfGames.Nitride.Tests.csproj b/tests/MfGames.Nitride.Tests/MfGames.Nitride.Tests.csproj index 911b1c7..e040383 100644 --- a/tests/MfGames.Nitride.Tests/MfGames.Nitride.Tests.csproj +++ b/tests/MfGames.Nitride.Tests/MfGames.Nitride.Tests.csproj @@ -8,13 +8,13 @@ - - - - - - - + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -26,7 +26,7 @@ - + diff --git a/tests/MfGames.Nitride.Tests/TestHelper.cs b/tests/MfGames.Nitride.Tests/TestHelper.cs index fae86df..6d928c2 100644 --- a/tests/MfGames.Nitride.Tests/TestHelper.cs +++ b/tests/MfGames.Nitride.Tests/TestHelper.cs @@ -35,11 +35,13 @@ public static class TestHelper message.AppendLine("# Expected"); message.AppendLine(); - message.AppendLine(JsonConvert.SerializeObject(expected, Formatting.Indented)); + message.AppendLine( + JsonConvert.SerializeObject(expected, Formatting.Indented)); message.AppendLine(); message.AppendLine("# Actual"); message.AppendLine(); - message.AppendLine(JsonConvert.SerializeObject(actual, Formatting.Indented)); + message.AppendLine( + JsonConvert.SerializeObject(actual, Formatting.Indented)); message.AppendLine(); message.Append("# Results"); message.AppendLine(); diff --git a/tests/MfGames.Nitride.Yaml.Tests/MfGames.Nitride.Yaml.Tests.csproj b/tests/MfGames.Nitride.Yaml.Tests/MfGames.Nitride.Yaml.Tests.csproj index ec613c8..0147bb0 100644 --- a/tests/MfGames.Nitride.Yaml.Tests/MfGames.Nitride.Yaml.Tests.csproj +++ b/tests/MfGames.Nitride.Yaml.Tests/MfGames.Nitride.Yaml.Tests.csproj @@ -6,10 +6,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -21,9 +21,9 @@ - - - + + + diff --git a/tests/MfGames.Nitride.Yaml.Tests/ParseYamlHeaderTest.cs b/tests/MfGames.Nitride.Yaml.Tests/ParseYamlHeaderTest.cs index 7c29f13..63af76e 100644 --- a/tests/MfGames.Nitride.Yaml.Tests/ParseYamlHeaderTest.cs +++ b/tests/MfGames.Nitride.Yaml.Tests/ParseYamlHeaderTest.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using MfGames.Gallium; - using MfGames.Nitride.Contents; using MfGames.Nitride.Tests; @@ -23,7 +22,8 @@ public class ParseYamlHeaderTest : NitrideTestBase { var input = new List { - new Entity().SetTextContent(new StringTextContent("---", "title: Test Title 1", "---")) + new Entity().SetTextContent( + new StringTextContent("---", "title: Test Title 1", "---")) }; var op = new ParseYamlHeader(); @@ -87,7 +87,12 @@ public class ParseYamlHeaderTest : NitrideTestBase { var input = new List { - new Entity().SetTextContent(new StringTextContent("---", "title: Test Title 1", "---", "Hello")) + new Entity().SetTextContent( + new StringTextContent( + "---", + "title: Test Title 1", + "---", + "Hello")) }; var op = new ParseYamlHeader();