question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--include / --files documentation is confusing

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JoeRobichcommented, Aug 9, 2020

@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!

1reaction
jmarolfcommented, Apr 13, 2020

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found