Beispiel #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());
            }
        }
Beispiel #2
0
        public string CreateAnalyzersMarkDown()
        {
            using (var sw = new StringWriter())
            {
                sw.WriteLine("## Roslynator Analyzers");
                sw.WriteLine();

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

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

                    sw.WriteLine();
                }

                return(sw.ToString());
            }
        }
Beispiel #3
0
        private void WriteAnalyzersTable(IEnumerable <AnalyzerInfo> infos, StringWriter sw)
        {
            sw.WriteLine(" Id | Title | Enabled by Default ");
            sw.WriteLine(" --- | --- |:---:");

            foreach (AnalyzerInfo info in infos)
            {
                sw.Write(info.Id);
                sw.Write('|');
                sw.Write(MarkdownHelper.Escape(info.Title.TrimEnd('.')));
                sw.Write('|');
                sw.Write((info.IsEnabledByDefault) ? "x" : "");

                sw.WriteLine();
            }
        }