Exemple #1
0
        public string CreateAnalyzersByCategoryMarkDown()
        {
            using (var sw = new StringWriter())
            {
                sw.WriteLine("## Roslynator Analyzers by Category");
                sw.WriteLine();

                sw.WriteLine(" Category | Title | Id | Enabled by Default ");
                sw.WriteLine(" --- | --- | --- |:---:");

                foreach (IGrouping <string, AnalyzerInfo> grouping in Analyzers
                         .GroupBy(f => f.Category)
                         .OrderBy(f => f.Key, StringComparer))
                {
                    foreach (AnalyzerInfo info in grouping.OrderBy(f => f.Title, StringComparer))
                    {
                        sw.Write(grouping.Key);
                        sw.Write('|');
                        sw.Write(MarkdownHelper.Escape(info.Title.TrimEnd('.')));
                        sw.Write('|');
                        sw.Write(info.Id);
                        sw.Write('|');
                        sw.Write((info.IsEnabledByDefault) ? "x" : "");

                        sw.WriteLine();
                    }
                }

                return(sw.ToString());
            }
        }