dotnet / format

Home for the dotnet-format command
MIT License
1.94k stars 172 forks source link

Feature Request: Support for Excluding Specific Subcommands with --skip in dotnet format #2204

Open MohammadAminPourmoradian opened 3 months ago

MohammadAminPourmoradian commented 3 months ago

Description: The dotnet format command currently supports three subcommands: whitespace, style, and analyzers. However, there is no option to exclude a specific subcommand while running the rest in a single command. This limitation forces users to run multiple commands to achieve desired formatting.

Proposed Improvement: Introduce a new switch, --skip, to allow excluding specific subcommands while applying the rest in a single dotnet format command. For example:

dotnet format --skip whitespace

Example Scenario: In a project, we want to run the dotnet format command without considering analyzers, but still include style and whitespace formatting. Currently, we are forced to run two separate commands:

dotnet format whitespace
dotnet format style

With the proposed --skip switch, we could achieve the same result with a single command: dotnet format --skip analyzers

Benefits:

Simplified Workflow: Allows users to exclude a specific subcommand while running the remaining subcommands in one go. Time-Saving: Reduces the number of commands needed to achieve desired formatting, saving time and effort. Enhanced Control: Provides users with more flexibility over the formatting process, tailoring it to their specific needs.

Additional Notes: An alternative could be to introduce an option that allows users to include or exclude multiple subcommands dynamically, offering greater customization and control.