dotnet / format

Home for the dotnet-format command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question regarding build options and execution times

aljosalindic opened this issue · comments

Hello,
First of all, thank you for the amazing tool.
I'm using the following command to format and style my .cs files:

dotnet format --include $COMBINED_PATHS --severity info --verbosity normal --no-restore

In this case $COMBINED_PATHS variable includes a list of relative file paths of the files that were changed and need to be formatted and styled.
The .editorconfig was configured and set up through the new integrated visual studio .editorconfig editing tool.

On average processing a single .cs file (about 480 lines of code) takes 35 seconds and more.
To me this seems a bit too long for just applying some styles and fixing the whitespaces. Is 35 seconds the expected time for this kind of a command to execute?

I am curious if there's any way to shed a few seconds and shorten the execution times?
Is the tool somehow building the entire solution/project in order to be able to apply some of the specified styles (like for example csharp_prefer_static_local_function)? If so, is there any way to enable/disable this through options?

In reality I only need to run dotnet format whitespace (which executes in about 7-8 seconds) and dotnet format style,(which executes in about 25 seconds) without the dotnet format analyzers. Is there a way to run only the first two subcommands, or would I need to call each one separately?

Thank you in advance!