diff --git a/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe.csproj b/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe.csproj index ffb61834..aea5d9d7 100644 --- a/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe.csproj +++ b/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe.csproj @@ -48,6 +48,7 @@ For recipe compatible with Cake Script Runners see Cake.Issues.Recipe. + diff --git a/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IIssuesParametersInputFiles.cs b/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IIssuesParametersInputFiles.cs index 89d45d6c..d34d6fec 100644 --- a/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IIssuesParametersInputFiles.cs +++ b/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IIssuesParametersInputFiles.cs @@ -87,6 +87,36 @@ public interface IIssuesParametersInputFiles /// IDictionary SarifLogFileContent { get; } + /// + /// Gets list of registered paths to TAP log files. + /// + IDictionary GenericTapLogFilePaths { get; } + + /// + /// Gets list of registered content of TAP log files. + /// + IDictionary GenericTapLogFileContent { get; } + + /// + /// Gets list of registered paths to Stylelint TAP log files. + /// + IDictionary StylelintTapLogFilePaths { get; } + + /// + /// Gets list of registered content of Stylelint TAP log files. + /// + IDictionary StylelintTapLogFileContent { get; } + + /// + /// Gets list of registered paths to Textlint TAP log files. + /// + IDictionary TextlintTapLogFilePaths { get; } + + /// + /// Gets list of registered content of Textlint TAP log files. + /// + IDictionary TextlintTapLogFileContent { get; } + /// /// Adds a path to a MSBuild log file created by XmlFileLogger. /// @@ -198,4 +228,46 @@ public interface IIssuesParametersInputFiles /// Content of the SARIF log file. /// Settings for reading the log file. Null for default values. void AddSarifLogFileContent(byte[] logfileContent, IReadIssuesSettings settings); + + /// + /// Adds a path to a log file in Test Anything Protocol format. + /// + /// Path to the log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + void AddGenericTapLogFilePath(FilePath logfilePath, IReadIssuesSettings settings); + + /// + /// Adds content of a log file in Test Anything Protocol format. + /// + /// Content of the log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + void AddGenericTapLogFileContent(byte[] logfileContent, IReadIssuesSettings settings); + + /// + /// Adds a path to a Stylelint log file in Test Anything Protocol format. + /// + /// Path to the Stylelint log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + void AddStylelintTapLogFilePath(FilePath logfilePath, IReadIssuesSettings settings); + + /// + /// Adds content of a Stylelint log file in Test Anything Protocol format. + /// + /// Content of the Stylelint log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + void AddStylelintTapLogFileContent(byte[] logfileContent, IReadIssuesSettings settings); + + /// + /// Adds a path to a Textlint log file in Test Anything Protocol format. + /// + /// Path to the Textlint log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + void AddTextlintTapLogFilePath(FilePath logfilePath, IReadIssuesSettings settings); + + /// + /// Adds content of a Textlint log file in Test Anything Protocol format. + /// + /// Content of the Textlint log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + void AddTextlintTapLogFileContent(byte[] logfileContent, IReadIssuesSettings settings); } \ No newline at end of file diff --git a/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IIssuesParametersInputFilesExtensions.cs b/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IIssuesParametersInputFilesExtensions.cs index c6af7f51..93521d2c 100644 --- a/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IIssuesParametersInputFilesExtensions.cs +++ b/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IIssuesParametersInputFilesExtensions.cs @@ -534,4 +534,202 @@ public static void AddSarifLogFileContent( } #endregion + + #region GenericTapLogFile + + /// + /// Adds a path to a log file in Test Anything Protocol format. + /// + /// Parameter instance. + /// Path to the log file in Test Anything Protocol format. + public static void AddGenericTapLogFilePath( + this IIssuesParametersInputFiles parameters, + FilePath logfilePath) + { + parameters.NotNull(); + logfilePath.NotNull(); + + parameters.AddGenericTapLogFilePath(logfilePath, null); + } + + /// + /// Adds content of a log file in Test Anything Protocol format. + /// + /// Parameter instance. + /// Content of the log file in Test Anything Protocol format. + public static void AddGenericTapLogFileContent( + this IIssuesParametersInputFiles parameters, + string logfileContent) + { + parameters.NotNull(); + logfileContent.NotNullOrWhiteSpace(); + + parameters.AddGenericTapLogFileContent(logfileContent.ToByteArray(), null); + } + + /// + /// Adds content of a log file in Test Anything Protocol format. + /// + /// Parameter instance. + /// Content of the log file in Test Anything Protocol format. + public static void AddGenericTapLogFileContent( + this IIssuesParametersInputFiles parameters, + byte[] logfileContent) + { + parameters.NotNull(); + logfileContent.NotNullOrEmpty(); + + parameters.AddGenericTapLogFileContent(logfileContent, null); + } + + /// + /// Adds content of a log file in Test Anything Protocol format. + /// + /// Parameter instance. + /// Content of the log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + public static void AddGenericTapLogFileContent( + this IIssuesParametersInputFiles parameters, + string logfileContent, + IReadIssuesSettings settings) + { + parameters.NotNull(); + logfileContent.NotNullOrEmpty(); + + parameters.AddGenericTapLogFileContent(logfileContent.ToByteArray(), settings); + } + + #endregion + + #region StylelintTapLogFile + + /// + /// Adds a path to a Stylelint log file in Test Anything Protocol format. + /// + /// Parameter instance. + /// Path to the Stylelint log file in Test Anything Protocol format. + public static void AddStylelintTapLogFilePath( + this IIssuesParametersInputFiles parameters, + FilePath logfilePath) + { + parameters.NotNull(); + logfilePath.NotNull(); + + parameters.AddStylelintTapLogFilePath(logfilePath, null); + } + + /// + /// Adds content of a Stylelint log file in Test Anything Protocol format. + /// + /// Parameter instance. + /// Content of the Stylelint log file in Test Anything Protocol format. + public static void AddStylelintTapLogFileContent( + this IIssuesParametersInputFiles parameters, + string logfileContent) + { + parameters.NotNull(); + logfileContent.NotNullOrWhiteSpace(); + + parameters.AddStylelintTapLogFileContent(logfileContent.ToByteArray(), null); + } + + /// + /// Adds content of a Stylelint log file in Test Anything Protocol format. + /// + /// Parameter instance. + /// Content of the Stylelint log file in Test Anything Protocol format. + public static void AddStylelintTapLogFileContent( + this IIssuesParametersInputFiles parameters, + byte[] logfileContent) + { + parameters.NotNull(); + logfileContent.NotNullOrEmpty(); + + parameters.AddStylelintTapLogFileContent(logfileContent, null); + } + + /// + /// Adds content of a Stylelint log file in Test Anything Protocol format. + /// + /// Parameter instance. + /// Content of the Stylelint log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + public static void AddStylelintTapLogFileContent( + this IIssuesParametersInputFiles parameters, + string logfileContent, + IReadIssuesSettings settings) + { + parameters.NotNull(); + logfileContent.NotNullOrEmpty(); + + parameters.AddStylelintTapLogFileContent(logfileContent.ToByteArray(), settings); + } + + #endregion + + #region TextlintTapLogFile + + /// + /// Adds a path to a Textlint log file in Test Anything Protocol format. + /// + /// Parameter instance. + /// Path to the Textlint log file in Test Anything Protocol format. + public static void AddTextlintTapLogFilePath( + this IIssuesParametersInputFiles parameters, + FilePath logfilePath) + { + parameters.NotNull(); + logfilePath.NotNull(); + + parameters.AddTextlintTapLogFilePath(logfilePath, null); + } + + /// + /// Adds content of a Textlint log file in Test Anything Protocol format. + /// + /// Parameter instance. + /// Content of the Textlint log file in Test Anything Protocol format. + public static void AddTextlintTapLogFileContent( + this IIssuesParametersInputFiles parameters, + string logfileContent) + { + parameters.NotNull(); + logfileContent.NotNullOrWhiteSpace(); + + parameters.AddTextlintTapLogFileContent(logfileContent.ToByteArray(), null); + } + + /// + /// Adds content of a Textlint log file in Test Anything Protocol format. + /// + /// Parameter instance. + /// Content of the Textlint log file in Test Anything Protocol format. + public static void AddTextlintTapLogFileContent( + this IIssuesParametersInputFiles parameters, + byte[] logfileContent) + { + parameters.NotNull(); + logfileContent.NotNullOrEmpty(); + + parameters.AddTextlintTapLogFileContent(logfileContent, null); + } + + /// + /// Adds content of a Textlint log file in Test Anything Protocol format. + /// + /// Parameter instance. + /// Content of the Textlint log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + public static void AddTextlintTapLogFileContent( + this IIssuesParametersInputFiles parameters, + string logfileContent, + IReadIssuesSettings settings) + { + parameters.NotNull(); + logfileContent.NotNullOrEmpty(); + + parameters.AddTextlintTapLogFileContent(logfileContent.ToByteArray(), settings); + } + + #endregion } diff --git a/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IssuesParametersInputFiles.cs b/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IssuesParametersInputFiles.cs index 266f2311..beeef434 100644 --- a/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IssuesParametersInputFiles.cs +++ b/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IssuesParametersInputFiles.cs @@ -55,6 +55,24 @@ public class IssuesParametersInputFiles : IIssuesParametersInputFiles /// public IDictionary SarifLogFileContent { get; } = new Dictionary(); + /// + public IDictionary GenericTapLogFilePaths { get; } = new Dictionary(); + + /// + public IDictionary GenericTapLogFileContent { get; } = new Dictionary(); + + /// + public IDictionary StylelintTapLogFilePaths { get; } = new Dictionary(); + + /// + public IDictionary StylelintTapLogFileContent { get; } = new Dictionary(); + + /// + public IDictionary TextlintTapLogFilePaths { get; } = new Dictionary(); + + /// + public IDictionary TextlintTapLogFileContent { get; } = new Dictionary(); + /// public void AddMsBuildXmlFileLoggerLogFilePath(FilePath logfilePath, IReadIssuesSettings settings) { @@ -238,4 +256,73 @@ public void AddSarifLogFileContent(byte[] logfileContent, IReadIssuesSettings se this.SarifLogFileContent.Add(logfileContent, settings); } + + /// + public void AddGenericTapLogFilePath(FilePath logfilePath, IReadIssuesSettings settings) + { + logfilePath.NotNull(); + + if (this.GenericTapLogFilePaths.ContainsKey(logfilePath)) + { + throw new ArgumentException( + $"The path '{logfilePath.FullPath}' is already registered for the Generic TAP issue provider.", + nameof(logfilePath)); + } + + this.GenericTapLogFilePaths.Add(logfilePath, settings); + } + + /// + public void AddGenericTapLogFileContent(byte[] logfileContent, IReadIssuesSettings settings) + { + logfileContent.NotNullOrEmpty(); + + this.GenericTapLogFileContent.Add(logfileContent, settings); + } + + /// + public void AddStylelintTapLogFilePath(FilePath logfilePath, IReadIssuesSettings settings) + { + logfilePath.NotNull(); + + if (this.StylelintTapLogFilePaths.ContainsKey(logfilePath)) + { + throw new ArgumentException( + $"The path '{logfilePath.FullPath}' is already registered for the Stylelint TAP issue provider.", + nameof(logfilePath)); + } + + this.StylelintTapLogFilePaths.Add(logfilePath, settings); + } + + /// + public void AddStylelintTapLogFileContent(byte[] logfileContent, IReadIssuesSettings settings) + { + logfileContent.NotNullOrEmpty(); + + this.StylelintTapLogFileContent.Add(logfileContent, settings); + } + + /// + public void AddTextlintTapLogFilePath(FilePath logfilePath, IReadIssuesSettings settings) + { + logfilePath.NotNull(); + + if (this.StylelintTapLogFilePaths.ContainsKey(logfilePath)) + { + throw new ArgumentException( + $"The path '{logfilePath.FullPath}' is already registered for the Textlint TAP issue provider.", + nameof(logfilePath)); + } + + this.StylelintTapLogFilePaths.Add(logfilePath, settings); + } + + /// + public void AddTextlintTapLogFileContent(byte[] logfileContent, IReadIssuesSettings settings) + { + logfileContent.NotNullOrEmpty(); + + this.StylelintTapLogFileContent.Add(logfileContent, settings); + } } \ No newline at end of file diff --git a/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/ReadIssuesTask.cs b/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/ReadIssuesTask.cs index 3db18ad4..6a05f6a9 100644 --- a/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/ReadIssuesTask.cs +++ b/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/ReadIssuesTask.cs @@ -185,6 +185,60 @@ public override void Run(IIssuesContext context) logFileContent.Value); } + // Read generic TAP log files. + foreach (var logFile in context.Parameters.InputFiles.GenericTapLogFilePaths) + { + context.State.AddIssues( + context.TapIssues( + new TapIssuesSettings(logFile.Key, context.GenericLogFileFormat())), + logFile.Value); + } + + // Read generic TAP content. + foreach (var logFileContent in context.Parameters.InputFiles.GenericTapLogFileContent) + { + context.State.AddIssues( + context.TapIssues( + new TapIssuesSettings(logFileContent.Key, context.GenericLogFileFormat())), + logFileContent.Value); + } + + // Read Stylelint TAP log files. + foreach (var logFile in context.Parameters.InputFiles.StylelintTapLogFilePaths) + { + context.State.AddIssues( + context.TapIssues( + new TapIssuesSettings(logFile.Key, context.StylelintLogFileFormat())), + logFile.Value); + } + + // Read Stylelint TAP content. + foreach (var logFileContent in context.Parameters.InputFiles.StylelintTapLogFileContent) + { + context.State.AddIssues( + context.TapIssues( + new TapIssuesSettings(logFileContent.Key, context.StylelintLogFileFormat())), + logFileContent.Value); + } + + // Read Textlint TAP log files. + foreach (var logFile in context.Parameters.InputFiles.TextlintTapLogFilePaths) + { + context.State.AddIssues( + context.TapIssues( + new TapIssuesSettings(logFile.Key, context.TextlintLogFileFormat())), + logFile.Value); + } + + // Read Textlint TAP content. + foreach (var logFileContent in context.Parameters.InputFiles.TextlintTapLogFileContent) + { + context.State.AddIssues( + context.TapIssues( + new TapIssuesSettings(logFileContent.Key, context.TextlintLogFileFormat())), + logFileContent.Value); + } + context.Information("{0} issues are found.", context.State.Issues.Count()); } } diff --git a/Cake.Issues.Recipe/Content/addins.cake b/Cake.Issues.Recipe/Content/addins.cake index 43bd72b3..27464c25 100644 --- a/Cake.Issues.Recipe/Content/addins.cake +++ b/Cake.Issues.Recipe/Content/addins.cake @@ -9,6 +9,7 @@ #addin nuget:?package=Cake.Issues.Markdownlint&version=5.4.0 #addin nuget:?package=Cake.Issues.EsLint&version=5.4.0 #addin nuget:?package=Cake.Issues.Sarif&version=5.4.0 +#addin nuget:?package=Cake.Issues.Tap&version=5.4.0 #addin nuget:?package=Cake.Issues.Reporting&version=5.4.0 #addin nuget:?package=Cake.Issues.Reporting.Generic&version=5.4.0 #addin nuget:?package=Cake.Issues.Reporting.Sarif&version=5.4.0 diff --git a/Cake.Issues.Recipe/Content/build.cake b/Cake.Issues.Recipe/Content/build.cake index 283b141a..11d84ba9 100644 --- a/Cake.Issues.Recipe/Content/build.cake +++ b/Cake.Issues.Recipe/Content/build.cake @@ -244,6 +244,72 @@ IssuesBuildTasks.ReadIssuesTask = Task("Read-Issues") logFileContent.Value); } + // Read generic TAP log files. + foreach (var logFile in IssuesParameters.InputFiles.GenericTapLogFilePaths) + { + data.AddIssues( + TapIssues( + new TapIssuesSettings( + logFile.Key, + GenericLogFileFormat)), + logFile.Value); + } + + // Read generic TAP content. + foreach (var logFileContent in IssuesParameters.InputFiles.GenericTapLogFileContent) + { + data.AddIssues( + TapIssues( + new TapIssuesSettings( + logFileContent.Key, + GenericLogFileFormat)), + logFileContent.Value); + } + + // Read Stylelint TAP log files. + foreach (var logFile in IssuesParameters.InputFiles.GenericTapLogFilePaths) + { + data.AddIssues( + TapIssues( + new TapIssuesSettings( + logFile.Key, + StylelintLogFileFormat)), + logFile.Value); + } + + // Read Stylelint TAP content. + foreach (var logFileContent in IssuesParameters.InputFiles.GenericTapLogFileContent) + { + data.AddIssues( + TapIssues( + new TapIssuesSettings( + logFileContent.Key, + StylelintLogFileFormat)), + logFileContent.Value); + } + + // Read Textlint TAP log files. + foreach (var logFile in IssuesParameters.InputFiles.GenericTapLogFilePaths) + { + data.AddIssues( + TapIssues( + new TapIssuesSettings( + logFile.Key, + TextlintLogFileFormat)), + logFile.Value); + } + + // Read Textlint TAP content. + foreach (var logFileContent in IssuesParameters.InputFiles.GenericTapLogFileContent) + { + data.AddIssues( + TapIssues( + new TapIssuesSettings( + logFileContent.Key, + TextlintLogFileFormat)), + logFileContent.Value); + } + Information("{0} issues are found.", data.Issues.Count()); }); diff --git a/Cake.Issues.Recipe/Content/parameters/IssuesParametersInputFiles.cake b/Cake.Issues.Recipe/Content/parameters/IssuesParametersInputFiles.cake index 0f79a4a8..168832c0 100644 --- a/Cake.Issues.Recipe/Content/parameters/IssuesParametersInputFiles.cake +++ b/Cake.Issues.Recipe/Content/parameters/IssuesParametersInputFiles.cake @@ -83,6 +83,36 @@ public class IssuesParametersInputFiles /// public IDictionary SarifLogFileContent { get; } = new Dictionary(); + /// + /// Gets list of registered paths to TAP log files. + /// + public IDictionary GenericTapLogFilePaths { get; } = new Dictionary(); + + /// + /// Gets list of registered content of TAP log files. + /// + public IDictionary GenericTapLogFileContent { get; } = new Dictionary(); + + /// + /// Gets list of registered paths to Stylelint TAP log files. + /// + public IDictionary StylelintTapLogFilePaths { get; } = new Dictionary(); + + /// + /// Gets list of registered content of Stylelint TAP log files. + /// + public IDictionary StylelintTapLogFileContent { get; } = new Dictionary(); + + /// + /// Gets list of registered paths to Textlint TAP log files. + /// + public IDictionary TextlintTapLogFilePaths { get; } = new Dictionary(); + + /// + /// Gets list of registered content of Textlint TAP log files. + /// + public IDictionary TextlintTapLogFileContent { get; } = new Dictionary(); + #region MsBuildXmlFileLoggerLogFile /// @@ -725,4 +755,250 @@ public class IssuesParametersInputFiles } #endregion + + #region GenericTapLogFile + + /// + /// Adds a path to a log file in Test Anything Protocol format. + /// + /// Path to the log file in Test Anything Protocol format. + public void AddGenericTapLogFilePath(FilePath logfilePath) + { + logfilePath.NotNull(); + + this.AddGenericTapLogFilePath(logfilePath, null); + } + + /// + /// Adds a path to a log file in Test Anything Protocol format. + /// + /// Path to the log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + public void AddGenericTapLogFilePath(FilePath logfilePath, IReadIssuesSettings settings) + { + logfilePath.NotNull(); + + if (this.GenericTapLogFilePaths.ContainsKey(logfilePath)) + { + throw new ArgumentException( + $"The path '{logfilePath.FullPath}' is already registered for the Generic TAP issue provider.", + nameof(logfilePath)); + } + + this.GenericTapLogFilePaths.Add(logfilePath, settings); + } + + /// + /// Adds content of a log file in Test Anything Protocol format. + /// + /// Content of the log file in Test Anything Protocol format. + public void AddGenericTapLogFileContent(string logfileContent) + { + logfileContent.NotNullOrWhiteSpace(); + + this.AddGenericTapLogFileContent(logfileContent.ToByteArray(), null); + } + + /// + /// Adds content of a log file in Test Anything Protocol format. + /// + /// Content of the log file in Test Anything Protocol format. + public void AddGenericTapLogFileContent(byte[] logfileContent) + { + logfileContent.NotNullOrEmpty(); + + this.AddGenericTapLogFileContent(logfileContent, null); + } + + /// + /// Adds content of a log file in Test Anything Protocol format. + /// + /// Content of the log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + public void AddGenericTapLogFileContent( + string logfileContent, + IReadIssuesSettings settings) + { + logfileContent.NotNullOrEmpty(); + + this.AddGenericTapLogFileContent(logfileContent.ToByteArray(), settings); + } + + /// + /// Adds content of a log file in Test Anything Protocol format. + /// + /// Content of the log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + public void AddGenericTapLogFileContent(byte[] logfileContent, IReadIssuesSettings settings) + { + logfileContent.NotNullOrEmpty(); + + this.GenericTapLogFileContent.Add(logfileContent, settings); + } + + #endregion + + #region StylelintTapLogFile + + /// + /// Adds a path to a Stylelint log file in Test Anything Protocol format. + /// + /// Path to the Stylelint log file in Test Anything Protocol format. + public void AddStylelintTapLogFilePath(FilePath logfilePath) + { + logfilePath.NotNull(); + + this.AddStylelintTapLogFilePath(logfilePath, null); + } + + /// + /// Adds a path to a Stylelint log file in Test Anything Protocol format. + /// + /// Path to the Stylelint log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + public void AddStylelintTapLogFilePath(FilePath logfilePath, IReadIssuesSettings settings) + { + logfilePath.NotNull(); + + if (this.StylelintTapLogFilePaths.ContainsKey(logfilePath)) + { + throw new ArgumentException( + $"The path '{logfilePath.FullPath}' is already registered for the Stylelint TAP issue provider.", + nameof(logfilePath)); + } + + this.StylelintTapLogFilePaths.Add(logfilePath, settings); + } + + /// + /// Adds content of a Stylelint log file in Test Anything Protocol format. + /// + /// Content of the Stylelint log file in Test Anything Protocol format. + public void AddStylelintTapLogFileContent(string logfileContent) + { + logfileContent.NotNullOrWhiteSpace(); + + this.AddStylelintTapLogFileContent(logfileContent.ToByteArray(), null); + } + + /// + /// Adds content of a Stylelint log file in Test Anything Protocol format. + /// + /// Content of the Stylelint log file in Test Anything Protocol format. + public void AddStylelintTapLogFileContent(byte[] logfileContent) + { + logfileContent.NotNullOrEmpty(); + + this.AddStylelintTapLogFileContent(logfileContent, null); + } + + /// + /// Adds content of a Stylelint log file in Test Anything Protocol format. + /// + /// Content of the Stylelint log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + public void AddStylelintTapLogFileContent( + string logfileContent, + IReadIssuesSettings settings) + { + logfileContent.NotNullOrEmpty(); + + this.AddStylelintTapLogFileContent(logfileContent.ToByteArray(), settings); + } + + /// + /// Adds content of a Stylelint log file in Test Anything Protocol format. + /// + /// Content of the Stylelint log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + public void AddStylelintTapLogFileContent(byte[] logfileContent, IReadIssuesSettings settings) + { + logfileContent.NotNullOrEmpty(); + + this.StylelintTapLogFileContent.Add(logfileContent, settings); + } + + #endregion + + #region TextlintTapLogFile + + /// + /// Adds a path to a Textlint log file in Test Anything Protocol format. + /// + /// Path to the Textlint log file in Test Anything Protocol format. + public void AddTextlintTapLogFilePath(FilePath logfilePath) + { + logfilePath.NotNull(); + + this.AddTextlintTapLogFilePath(logfilePath, null); + } + + /// + /// Adds a path to a Textlint log file in Test Anything Protocol format. + /// + /// Path to the Textlint log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + public void AddTextlintTapLogFilePath(FilePath logfilePath, IReadIssuesSettings settings) + { + logfilePath.NotNull(); + + if (this.TextlintTapLogFilePaths.ContainsKey(logfilePath)) + { + throw new ArgumentException( + $"The path '{logfilePath.FullPath}' is already registered for the Textlint TAP issue provider.", + nameof(logfilePath)); + } + + this.TextlintTapLogFilePaths.Add(logfilePath, settings); + } + + /// + /// Adds content of a Textlint log file in Test Anything Protocol format. + /// + /// Content of the Textlint log file in Test Anything Protocol format. + public void AddTextlintTapLogFileContent(string logfileContent) + { + logfileContent.NotNullOrWhiteSpace(); + + this.AddTextlintTapLogFileContent(logfileContent.ToByteArray(), null); + } + + /// + /// Adds content of a Textlint log file in Test Anything Protocol format. + /// + /// Content of the Textlint log file in Test Anything Protocol format. + public void AddTextlintTapLogFileContent(byte[] logfileContent) + { + logfileContent.NotNullOrEmpty(); + + this.AddTextlintTapLogFileContent(logfileContent, null); + } + + /// + /// Adds content of a Textlint log file in Test Anything Protocol format. + /// + /// Content of the Textlint log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + public void AddTextlintTapLogFileContent( + string logfileContent, + IReadIssuesSettings settings) + { + logfileContent.NotNullOrEmpty(); + + this.AddTextlintTapLogFileContent(logfileContent.ToByteArray(), settings); + } + + /// + /// Adds content of a Textlint log file in Test Anything Protocol format. + /// + /// Content of the Textlint log file in Test Anything Protocol format. + /// Settings for reading the log file. Null for default values. + public void AddTextlintTapLogFileContent(byte[] logfileContent, IReadIssuesSettings settings) + { + logfileContent.NotNullOrEmpty(); + + this.TextlintTapLogFileContent.Add(logfileContent, settings); + } + + #endregion } \ No newline at end of file