--include / --files documentation is confusing
See original GitHub issueWhen 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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
c++ - Is it better to document functions in the header file or ...
My view... Document how to use the function in the header file, or more accurately close to the declaration. Document how the function...
Read more >Doxygen isn't generating documentation for source files
My input FILE_PATTERNS include .c and .h, along with a bunch of other ones, and yet it still won't create documentation for .c...
Read more >Better documentation for how files are included in built ...
Issue While helping with licensezero/cli#3, I was looking for "how to do package data with poetry" but found the docs were unclear or...
Read more >The only thing I'm always struggling to understand is ...
I consider unclear documentation (or lack thereof) to be a bug. You could file an issue saying that the docs is not clear...
Read more >7 Code Documentation - Axom - Read the Docs
Document only what's needed¶. 7.1 Documentation should only include what is essential for users and other developers to easily understand code.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pgrm Please let me know if this documentation is sufficient - https://github.com/dotnet/format/tree/master/docs#filter-files-to-format. If not, please recommend how it could be improved. Thanks!
@qubitz you are correct.
By default running
dotnet format
will look for a solution/project file and attempt to formal all the*.cs
files in that are included there. It can be thought of as the default is an implicit-w
(the workspace option).--include
and--files
are synonyms for the same option as you can see here: https://github.com/dotnet/format/blob/aed51cf8bba5dcddb5f1c9ee718ceca4e0603822/src/Program.cs#L37