dotnet / dotnet/format

Question regarding build options and execution times

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

Description

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!

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.