Skip to content

Commit

Permalink
Remove old IDescriptionSections & IAbstractVisualizationTreeNode impl…
Browse files Browse the repository at this point in the history
…ementations (#5215)
  • Loading branch information
1 parent ce89890 commit 5b69473
Show file tree
Hide file tree
Showing 39 changed files with 576 additions and 3,416 deletions.
62 changes: 32 additions & 30 deletions build/tools/ExtractRuleDescFromJson/RuleDescExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,36 +103,38 @@ private static IEnumerable<PluginRule> LoadRules(string file)

private void ProcessRule(PluginRule pluginRule)
{
try
{
var descAsxml = HtmlXmlCompatibilityHelper.EnsureHtmlIsXml(pluginRule.Description);

var slvsRule = new RuleInfo(
pluginRule.Language?.ToLower() ?? throw new ArgumentNullException("language"),
pluginRule.Key ?? throw new ArgumentNullException("key"),
descAsxml,
pluginRule.Name ?? throw new ArgumentNullException("name"),
ConvertPluginSeverity(pluginRule.DefaultSeverity),
ConvertPluginIssueType(pluginRule.Type),
Convert.ToBoolean(pluginRule.IsActiveByDefault),
pluginRule.Tags ?? Array.Empty<string>(),
pluginRule.DescriptionSections?.Select(x => new SonarLint.VisualStudio.Rules.DescriptionSection(x.Key,
HtmlXmlCompatibilityHelper.EnsureHtmlIsXml(x.HtmlContent),
x.Context != null
? new SonarLint.VisualStudio.Rules.Context(x.Context.Key, x.Context.DisplayName)
: null)).ToList(),
pluginRule.EducationPrinciples,
null,
pluginRule.CleanCodeAttribute,
pluginRule.DefaultImpacts
);

SaveRuleFile(slvsRule);
}
catch (Exception ex)
{
Logger.LogError($"Error processing rule. Rule key: {pluginRule.Key}, file: {context.RuleJsonFilePath}, {ex.Message}");
}
return; // this will be deleted later

// try
// {
// var descAsxml = HtmlXmlCompatibilityHelper.EnsureHtmlIsXml(pluginRule.Description);
//
// var slvsRule = new RuleInfo(
// pluginRule.Language?.ToLower() ?? throw new ArgumentNullException("language"),
// pluginRule.Key ?? throw new ArgumentNullException("key"),
// descAsxml,
// pluginRule.Name ?? throw new ArgumentNullException("name"),
// ConvertPluginSeverity(pluginRule.DefaultSeverity),
// ConvertPluginIssueType(pluginRule.Type),
// Convert.ToBoolean(pluginRule.IsActiveByDefault),
// pluginRule.Tags ?? Array.Empty<string>(),
// pluginRule.DescriptionSections?.Select(x => new SonarLint.VisualStudio.Rules.DescriptionSection(x.Key,
// HtmlXmlCompatibilityHelper.EnsureHtmlIsXml(x.HtmlContent),
// x.Context != null
// ? new SonarLint.VisualStudio.Rules.Context(x.Context.Key, x.Context.DisplayName)
// : null)).ToList(),
// pluginRule.EducationPrinciples,
// null,
// pluginRule.CleanCodeAttribute,
// pluginRule.DefaultImpacts
// );
//
// SaveRuleFile(slvsRule);
// }
// catch (Exception ex)
// {
// Logger.LogError($"Error processing rule. Rule key: {pluginRule.Key}, file: {context.RuleJsonFilePath}, {ex.Message}");
// }
}

private static RuleIssueSeverity ConvertPluginSeverity(string? pluginSeverity)
Expand Down

This file was deleted.

111 changes: 0 additions & 111 deletions src/Education.UnitTests/Layout/Logical/HowToFixSectionTests.cs

This file was deleted.

89 changes: 0 additions & 89 deletions src/Education.UnitTests/Layout/Logical/ResourcesSectionTests.cs

This file was deleted.

53 changes: 0 additions & 53 deletions src/Education.UnitTests/Layout/Logical/RootCauseSectionTests.cs

This file was deleted.

Loading

0 comments on commit 5b69473

Please sign in to comment.