diff --git a/plugins/Microsoft.DocAsCode.Build.TagLevelRestApi/SplitRestApiToTagLevel.cs b/plugins/Microsoft.DocAsCode.Build.TagLevelRestApi/SplitRestApiToTagLevel.cs index b8f0c5d1249..88eb6b7a161 100644 --- a/plugins/Microsoft.DocAsCode.Build.TagLevelRestApi/SplitRestApiToTagLevel.cs +++ b/plugins/Microsoft.DocAsCode.Build.TagLevelRestApi/SplitRestApiToTagLevel.cs @@ -153,7 +153,7 @@ private FileModel GenerateNewFileModel(FileModel model, RestApiRootItemViewModel { LocalPathFromRoot = model.LocalPathFromRoot, Uids = CalculateUids(tagModel).Select(i => new UidDefinition(i, model.LocalPathFromRoot)).ToImmutableArray() - }; + }; return newModel; } diff --git a/src/Microsoft.DocAsCode.App/Config/ContentPairingInfo.cs b/src/Microsoft.DocAsCode.App/Config/ContentPairingInfo.cs index adb24ff4138..e4bc7eec77b 100644 --- a/src/Microsoft.DocAsCode.App/Config/ContentPairingInfo.cs +++ b/src/Microsoft.DocAsCode.App/Config/ContentPairingInfo.cs @@ -13,4 +13,4 @@ internal class ContentPairingInfo [JsonProperty("overwriteFragmentsFolder")] public string OverwriteFragmentsFolder { get; set; } -} \ No newline at end of file +} diff --git a/src/Microsoft.DocAsCode.App/Config/FileMetadataPairsItem.cs b/src/Microsoft.DocAsCode.App/Config/FileMetadataPairsItem.cs index 65acdb5b04c..4ab129da7aa 100644 --- a/src/Microsoft.DocAsCode.App/Config/FileMetadataPairsItem.cs +++ b/src/Microsoft.DocAsCode.App/Config/FileMetadataPairsItem.cs @@ -1,8 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.DocAsCode.Glob; using Microsoft.DocAsCode.Common; +using Microsoft.DocAsCode.Glob; namespace Microsoft.DocAsCode; diff --git a/src/Microsoft.DocAsCode.App/Config/ListWithStringFallbackConverter.cs b/src/Microsoft.DocAsCode.App/Config/ListWithStringFallbackConverter.cs index 111167c8987..fa2970552b0 100644 --- a/src/Microsoft.DocAsCode.App/Config/ListWithStringFallbackConverter.cs +++ b/src/Microsoft.DocAsCode.App/Config/ListWithStringFallbackConverter.cs @@ -53,7 +53,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { writer.WriteStartArray(); - foreach(var item in (ListWithStringFallback)value) + foreach (var item in (ListWithStringFallback)value) { serializer.Serialize(writer, item); } diff --git a/src/Microsoft.DocAsCode.App/Config/WkhtmltopdfJsonConfig.cs b/src/Microsoft.DocAsCode.App/Config/WkhtmltopdfJsonConfig.cs index d666af0db3d..b8a75e88b1c 100644 --- a/src/Microsoft.DocAsCode.App/Config/WkhtmltopdfJsonConfig.cs +++ b/src/Microsoft.DocAsCode.App/Config/WkhtmltopdfJsonConfig.cs @@ -22,4 +22,4 @@ internal class WkhtmltopdfJsonConfig /// [JsonProperty("additionalArguments")] public string AdditionalArguments { get; set; } -} \ No newline at end of file +} diff --git a/src/Microsoft.DocAsCode.App/Docset.cs b/src/Microsoft.DocAsCode.App/Docset.cs index 4a5a9d4c312..8c92d355486 100644 --- a/src/Microsoft.DocAsCode.App/Docset.cs +++ b/src/Microsoft.DocAsCode.App/Docset.cs @@ -21,7 +21,7 @@ public static Task Build(string configPath) { return Build(configPath, new()); } - + /// /// Builds a docset specified by docfx.json config. /// diff --git a/src/Microsoft.DocAsCode.App/Helpers/MetadataMerger.cs b/src/Microsoft.DocAsCode.App/Helpers/MetadataMerger.cs index 0fb5bd75903..53858fc3b65 100644 --- a/src/Microsoft.DocAsCode.App/Helpers/MetadataMerger.cs +++ b/src/Microsoft.DocAsCode.App/Helpers/MetadataMerger.cs @@ -2,14 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Immutable; - -using Microsoft.DocAsCode.Common; using Microsoft.DocAsCode.Build.Engine; using Microsoft.DocAsCode.Build.ManagedReference; +using Microsoft.DocAsCode.Common; using Microsoft.DocAsCode.DataContracts.Common; using Microsoft.DocAsCode.DataContracts.ManagedReference; -using Microsoft.DocAsCode.Plugins; using Microsoft.DocAsCode.MarkdigEngine; +using Microsoft.DocAsCode.Plugins; namespace Microsoft.DocAsCode; diff --git a/src/Microsoft.DocAsCode.App/RunBuild.cs b/src/Microsoft.DocAsCode.App/RunBuild.cs index 7939245847f..50e4bdcc5dc 100644 --- a/src/Microsoft.DocAsCode.App/RunBuild.cs +++ b/src/Microsoft.DocAsCode.App/RunBuild.cs @@ -23,7 +23,7 @@ public static string Exec(BuildJsonConfig config, BuildOptions options, string c // TODO: remove BaseDirectory from Config, it may cause potential issue when abused var baseDirectory = EnvironmentContext.BaseDirectory; var outputFolder = Path.GetFullPath(Path.Combine( - string.IsNullOrEmpty(outputDirectory) ? Path.Combine(baseDirectory, config.Output ?? "") : outputDirectory, + string.IsNullOrEmpty(outputDirectory) ? Path.Combine(baseDirectory, config.Output ?? "") : outputDirectory, config.Destination ?? "")); try diff --git a/src/Microsoft.DocAsCode.App/RunPdf.cs b/src/Microsoft.DocAsCode.App/RunPdf.cs index 351a7551050..4d6c0ae94c3 100644 --- a/src/Microsoft.DocAsCode.App/RunPdf.cs +++ b/src/Microsoft.DocAsCode.App/RunPdf.cs @@ -25,7 +25,7 @@ public static void Exec(PdfJsonConfig config, BuildOptions buildOptions, string } var outputFolder = Path.GetFullPath(Path.Combine( - string.IsNullOrEmpty(outputDirectory) ? Path.Combine(baseDirectory, config.Output ?? "") : outputDirectory, + string.IsNullOrEmpty(outputDirectory) ? Path.Combine(baseDirectory, config.Output ?? "") : outputDirectory, config.Destination ?? "")); var rawOutputFolder = string.IsNullOrEmpty(config.RawOutputFolder) ? Path.Combine(outputFolder, "_raw") : config.RawOutputFolder; diff --git a/src/Microsoft.DocAsCode.Build.Common/ModelAttributeHandlers/Handlers/BaseModelAttributeHandler.cs b/src/Microsoft.DocAsCode.Build.Common/ModelAttributeHandlers/Handlers/BaseModelAttributeHandler.cs index 6b53e470dbd..6f2f43f116d 100644 --- a/src/Microsoft.DocAsCode.Build.Common/ModelAttributeHandlers/Handlers/BaseModelAttributeHandler.cs +++ b/src/Microsoft.DocAsCode.Build.Common/ModelAttributeHandlers/Handlers/BaseModelAttributeHandler.cs @@ -5,7 +5,7 @@ namespace Microsoft.DocAsCode.Build.Common; -public abstract class BaseModelAttributeHandler : IModelAttributeHandler where T: Attribute +public abstract class BaseModelAttributeHandler : IModelAttributeHandler where T : Attribute { private const int MaximumNestedLevel = 32; private readonly TypeInfo _typeInfo; diff --git a/src/Microsoft.DocAsCode.Build.Common/Reference/ApplyOverwriteDocument.cs b/src/Microsoft.DocAsCode.Build.Common/Reference/ApplyOverwriteDocument.cs index 02457d227cb..6473cfde2bb 100644 --- a/src/Microsoft.DocAsCode.Build.Common/Reference/ApplyOverwriteDocument.cs +++ b/src/Microsoft.DocAsCode.Build.Common/Reference/ApplyOverwriteDocument.cs @@ -2,12 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Immutable; - using Microsoft.DocAsCode.Common; +using Microsoft.DocAsCode.Common.EntityMergers; using Microsoft.DocAsCode.DataContracts.Common; using Microsoft.DocAsCode.Plugins; -using Microsoft.DocAsCode.Common.EntityMergers; - using YamlDotNet.Core; namespace Microsoft.DocAsCode.Build.Common; diff --git a/src/Microsoft.DocAsCode.Build.Common/Reference/OverwriteDocumentModel.cs b/src/Microsoft.DocAsCode.Build.Common/Reference/OverwriteDocumentModel.cs index a62e083cf46..9535d253827 100644 --- a/src/Microsoft.DocAsCode.Build.Common/Reference/OverwriteDocumentModel.cs +++ b/src/Microsoft.DocAsCode.Build.Common/Reference/OverwriteDocumentModel.cs @@ -2,14 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Immutable; - -using Newtonsoft.Json; -using YamlDotNet.Serialization; - using Microsoft.DocAsCode.Common; using Microsoft.DocAsCode.DataContracts.Common; using Microsoft.DocAsCode.Plugins; using Microsoft.DocAsCode.YamlSerialization; +using Newtonsoft.Json; +using YamlDotNet.Serialization; namespace Microsoft.DocAsCode.Build.Common; diff --git a/src/Microsoft.DocAsCode.Build.Common/Reference/OverwriteDocumentReader.cs b/src/Microsoft.DocAsCode.Build.Common/Reference/OverwriteDocumentReader.cs index 90e58acb5f3..4310626d7f8 100644 --- a/src/Microsoft.DocAsCode.Build.Common/Reference/OverwriteDocumentReader.cs +++ b/src/Microsoft.DocAsCode.Build.Common/Reference/OverwriteDocumentReader.cs @@ -1,14 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using YamlDotNet.Serialization; -using YamlDotNet.Core; -using YamlDotNet.Serialization.Utilities; - using Microsoft.DocAsCode.Common; using Microsoft.DocAsCode.DataContracts.Common; using Microsoft.DocAsCode.Plugins; - +using YamlDotNet.Core; +using YamlDotNet.Serialization; +using YamlDotNet.Serialization.Utilities; using Constants = Microsoft.DocAsCode.DataContracts.Common.Constants; using YamlDeserializer = Microsoft.DocAsCode.YamlSerialization.YamlDeserializer; diff --git a/src/Microsoft.DocAsCode.Build.ConceptualDocuments/ValidateConceptualDocumentMetadata.cs b/src/Microsoft.DocAsCode.Build.ConceptualDocuments/ValidateConceptualDocumentMetadata.cs index 59ee447f7e6..d0b421ccf17 100644 --- a/src/Microsoft.DocAsCode.Build.ConceptualDocuments/ValidateConceptualDocumentMetadata.cs +++ b/src/Microsoft.DocAsCode.Build.ConceptualDocuments/ValidateConceptualDocumentMetadata.cs @@ -30,7 +30,7 @@ public override void Build(FileModel model, IHostService host) return; } var metadata = ((Dictionary)model.Content).ToImmutableDictionary().Remove(ConceptualKey); - if(!model.Properties.IsUserDefinedTitle) + if (!model.Properties.IsUserDefinedTitle) { metadata = metadata.Remove(Constants.PropertyName.Title); } diff --git a/src/Microsoft.DocAsCode.Build.Engine/DocumentBuildContext.cs b/src/Microsoft.DocAsCode.Build.Engine/DocumentBuildContext.cs index be851062c31..45830297798 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/DocumentBuildContext.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/DocumentBuildContext.cs @@ -20,7 +20,7 @@ public sealed class DocumentBuildContext : IDocumentBuildContext public DocumentBuildContext(string buildOutputFolder) : this(buildOutputFolder, Enumerable.Empty(), ImmutableArray.Empty, ImmutableArray.Empty, 1, Directory.GetCurrentDirectory(), string.Empty, null, null) { } - + public DocumentBuildContext(string buildOutputFolder, IEnumerable allSourceFiles, ImmutableArray externalReferencePackages, ImmutableArray xrefMaps, int maxParallelism, string baseFolder, string versionName, ApplyTemplateSettings applyTemplateSetting, string rootTocPath) : this(buildOutputFolder, allSourceFiles, externalReferencePackages, xrefMaps, maxParallelism, baseFolder, versionName, applyTemplateSetting, rootTocPath, null) { } @@ -287,11 +287,11 @@ private List LoadXRefMaps() { Logger.LogInfo($"Downloading xref maps from:{Environment.NewLine}{string.Join(Environment.NewLine, _xrefMapUrls)}"); var mapTasks = (from url in _xrefMapUrls - select LoadXRefMap(url, _client)).ToArray(); + select LoadXRefMap(url, _client)).ToArray(); Task.WaitAll(mapTasks); return (from t in mapTasks - where t.Result != null - select t.Result).ToList(); + where t.Result != null + select t.Result).ToList(); } private async Task LoadXRefMap(string url, HttpClient client) diff --git a/src/Microsoft.DocAsCode.Build.Engine/DocumentBuilder.cs b/src/Microsoft.DocAsCode.Build.Engine/DocumentBuilder.cs index c20895dcbd0..b18e3355670 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/DocumentBuilder.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/DocumentBuilder.cs @@ -6,13 +6,11 @@ using System.Composition.Hosting; using System.Reflection; using System.Text; - -using Newtonsoft.Json; - using Microsoft.DocAsCode.Build.SchemaDriven; using Microsoft.DocAsCode.Common; using Microsoft.DocAsCode.MarkdigEngine; using Microsoft.DocAsCode.Plugins; +using Newtonsoft.Json; namespace Microsoft.DocAsCode.Build.Engine; diff --git a/src/Microsoft.DocAsCode.Build.Engine/MarkupResultUtility.cs b/src/Microsoft.DocAsCode.Build.Engine/MarkupResultUtility.cs index 407b34f5865..bdb21a0648c 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/MarkupResultUtility.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/MarkupResultUtility.cs @@ -3,12 +3,10 @@ using System.Collections.Immutable; using System.Net; - +using HtmlAgilityPack; using Microsoft.DocAsCode.Common; using Microsoft.DocAsCode.Plugins; -using HtmlAgilityPack; - namespace Microsoft.DocAsCode.Build.Engine; public static class MarkupUtility diff --git a/src/Microsoft.DocAsCode.Build.Engine/PostProcessors/HtmlDocumentHandler.cs b/src/Microsoft.DocAsCode.Build.Engine/PostProcessors/HtmlDocumentHandler.cs index 8fd07d4c69b..190edf58582 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/PostProcessors/HtmlDocumentHandler.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/PostProcessors/HtmlDocumentHandler.cs @@ -1,11 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using HtmlAgilityPack; using Microsoft.DocAsCode.Common; using Microsoft.DocAsCode.Plugins; -using HtmlAgilityPack; - namespace Microsoft.DocAsCode.Build.Engine; public abstract class HtmlDocumentHandler : IHtmlDocumentHandler diff --git a/src/Microsoft.DocAsCode.Build.Engine/PostProcessors/SearchIndexItem.cs b/src/Microsoft.DocAsCode.Build.Engine/PostProcessors/SearchIndexItem.cs index e6bba3307bf..21a4aae739b 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/PostProcessors/SearchIndexItem.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/PostProcessors/SearchIndexItem.cs @@ -38,4 +38,4 @@ public override int GetHashCode() { return Title.GetHashCode() ^ Href.GetHashCode() ^ Keywords.GetHashCode(); } -} \ No newline at end of file +} diff --git a/src/Microsoft.DocAsCode.Build.Engine/ResourceFileReaders/CompositeResourceReader.cs b/src/Microsoft.DocAsCode.Build.Engine/ResourceFileReaders/CompositeResourceReader.cs index 19f4e81e038..72121a4ac78 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/ResourceFileReaders/CompositeResourceReader.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/ResourceFileReaders/CompositeResourceReader.cs @@ -25,7 +25,7 @@ public override Stream GetResourceStream(string name) { for (var i = _readers.Length - 1; i >= 0; i--) { - if (_readers[i].GetResourceStream(name) is {} result) + if (_readers[i].GetResourceStream(name) is { } result) return result; } diff --git a/src/Microsoft.DocAsCode.Build.Engine/ResourceFileReaders/ResourceFileReader.cs b/src/Microsoft.DocAsCode.Build.Engine/ResourceFileReaders/ResourceFileReader.cs index 1838e57ac7c..91232962721 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/ResourceFileReaders/ResourceFileReader.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/ResourceFileReaders/ResourceFileReader.cs @@ -21,7 +21,7 @@ public virtual string GetResource(string name) public IEnumerable GetResources(string selector = null) { - foreach(var pair in GetResourceStreams(selector)) + foreach (var pair in GetResourceStreams(selector)) { using (pair.Value) { diff --git a/src/Microsoft.DocAsCode.Build.Engine/SystemMetadataGenerator.cs b/src/Microsoft.DocAsCode.Build.Engine/SystemMetadataGenerator.cs index 8555dfac48c..b62290a837d 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/SystemMetadataGenerator.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/SystemMetadataGenerator.cs @@ -154,7 +154,7 @@ private sealed class FileInfo public string FilePath { get; set; } - public RelativePath RelativePath{ get; set; } + public RelativePath RelativePath { get; set; } public FileInfo(string key, string filePath) { diff --git a/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Preprocessors/JintProcessorHelper.cs b/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Preprocessors/JintProcessorHelper.cs index fa3843ff3c0..282ab255934 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Preprocessors/JintProcessorHelper.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Preprocessors/JintProcessorHelper.cs @@ -20,7 +20,7 @@ public static JsValue ConvertObjectToJsValue(Jint.Engine engine, object raw) } else if (raw is IList list) { - var jsArray = new JsArray(engine, (uint) list.Count); + var jsArray = new JsArray(engine, (uint)list.Count); foreach (var item in list) { jsArray.Push(ConvertObjectToJsValue(engine, item)); diff --git a/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Preprocessors/TemplateJintPreprocessor.cs b/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Preprocessors/TemplateJintPreprocessor.cs index 70d4050aa1c..2e0df987591 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Preprocessors/TemplateJintPreprocessor.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Preprocessors/TemplateJintPreprocessor.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Jint.Native.Function; - using Jint; using Jint.Native; +using Jint.Native.Function; using Jint.Native.Object; using Microsoft.DocAsCode.Common; @@ -178,7 +177,7 @@ private Jint.Engine CreateEngine(Jint.Engine engine, params string[] sharedVaria var newEngine = CreateDefaultEngine(); if (sharedVariables != null) { - foreach(var sharedVariable in sharedVariables) + foreach (var sharedVariable in sharedVariables) { newEngine.SetValue(sharedVariable, engine.GetValue(sharedVariable)); } diff --git a/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Preprocessors/TemplateUtility.cs b/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Preprocessors/TemplateUtility.cs index 9c99c30bbe7..741ded1bedf 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Preprocessors/TemplateUtility.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Preprocessors/TemplateUtility.cs @@ -51,7 +51,7 @@ public string GetHrefFromRoot(string originalHref, string sourceFileKey) var file = path.GetPathFromWorkingFolder().UrlDecode(); if (!_context.AllSourceFiles.ContainsKey(file)) { - Logger.LogWarning($"Invalid file link: ({originalHref})", file:sourceFileKey, code:WarningCodes.Build.InvalidFileLink); + Logger.LogWarning($"Invalid file link: ({originalHref})", file: sourceFileKey, code: WarningCodes.Build.InvalidFileLink); return originalHref; } return file.UrlEncode().ToString() + UriUtility.GetQueryStringAndFragment(originalHref); diff --git a/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Template.cs b/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Template.cs index 49bb53126ec..bd815f152cf 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Template.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/Template.cs @@ -1,9 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Newtonsoft.Json.Linq; - using Microsoft.DocAsCode.Common; +using Newtonsoft.Json.Linq; namespace Microsoft.DocAsCode.Build.Engine; diff --git a/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/TemplatePageLoader.cs b/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/TemplatePageLoader.cs index a94850d250a..047a2206c9b 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/TemplatePageLoader.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/TemplateProcessors/TemplatePageLoader.cs @@ -18,20 +18,20 @@ public TemplatePageLoader(IResourceFileReader reader, DocumentBuildContext conte public IEnumerable