Skip to content

Using refactoring rules in a ruleset #1088

Closed

Description

@olivernybroe

Product and Version Used: Roslynator.Analyzers, Roslynator.Formatting.Analyzers,: 4.3.0

Steps to Reproduce:
Add a small program like so

// My comment
Console.WriteLine("Hello, World!");

Add RR0086 | Remove all comments rule to ruleset
RR0086 Remove all comments

<?xml version="1.0" encoding="utf-8" ?>
<RuleSet Name="Custom" ToolsVersion="15.0">
    <Rules AnalyzerId="Roslynator.CSharp.Analyzers" RuleNamespace="Roslynator.CSharp.Analyzers">
        <Rule Id="RR0086" Action="Error"/>
    </Rules>
</RuleSet>

Run format command

Actual Behavior:

// My comment
Console.WriteLine("Hello, World!");

Expected Behavior:

Console.WriteLine("Hello, World!");

Additional information

Thank you for the project! Sorry if this might just be my ignorance, but I am trying to multiple of the refactoring rules to automatically apply when running the formatting command, however it seems like I cannot get it to work.

When using the analyzer rules it works perfectly. Am I doing something wrong or is it just not supported to do refactoring rules in the ruleset?

Activity

  1. olivernybroe commented on May 12, 2023

    @olivernybroe
    Author

    Oh whoops... Did not see discussions were enabled, feel free to convert it to a discussion instead as it's prob. more appropriate there.

  2. locked and limited conversation to collaborators on May 12, 2023
  3. converted this issue into a discussion #1089 on May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions