dotnet / dotnet/format

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

Open
#2,204 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
1.9k
Forks
173
Avg merge
10d 13h
Merged PRs (30d)
1

Description

**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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.