Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MarkdownlintProvider"/> class.
        /// </summary>
        /// <param name="log">The Cake log context.</param>
        /// <param name="settings">Settings for reading the log file.</param>
        public MarkdownlintProvider(ICakeLog log, MarkdownlintSettings settings)
            : base(log)
        {
            settings.NotNull(nameof(settings));

            this.settings = settings;
        }
        public static ICodeAnalysisProvider MarkdownlintFromContent(
            this ICakeContext context,
            string logFileContent)
        {
            context.NotNull(nameof(context));
            logFileContent.NotNullOrWhiteSpace(nameof(logFileContent));

            return(context.Markdownlint(MarkdownlintSettings.FromContent(logFileContent)));
        }
        public static ICodeAnalysisProvider MarkdownlintFromFilePath(
            this ICakeContext context,
            FilePath logFilePath)
        {
            context.NotNull(nameof(context));
            logFilePath.NotNull(nameof(logFilePath));

            return(context.Markdownlint(MarkdownlintSettings.FromFilePath(logFilePath)));
        }
        public static ICodeAnalysisProvider Markdownlint(
            this ICakeContext context,
            MarkdownlintSettings settings)
        {
            context.NotNull(nameof(context));
            settings.NotNull(nameof(settings));

            return(new MarkdownlintProvider(context.Log, settings));
        }