dotnet / dotnet/format

--include / --files documentation is confusing

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

Description

When I run `dotnet format --files .\src\ProjectFolder\Program.cs -v detailed` I always see

```
Formatting code files in workspace 'SOLUTION_FOLDER\Solution.sln'.
Warnings were encountered while loading the workspace. Set the verbosity option to the 'diagnostic' level to log warnings.
Formatted 0 of 321 files.
Format complete in 5402ms.
```

I would have expected to see only one file formatted.

it works, when I run `dotnet format --folder . --files .\src\ProjectFolder\Program.cs -v detailed` (kudos to https://github.com/dotnet/format/issues/403)

But in the README it's described as `dotnet format --include Programs.cs Utility\Logging.cs` without further explanation (https://github.com/dotnet/format#how-to-use) - maybe it could be improved?

**Background:**

The reason I want to specify only specific files, is to run it as a pre-commit hook as quickly as possible.

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.