-
Notifications
You must be signed in to change notification settings - Fork 172
Filter out project early if it doesn't have any formattable documents #1485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter out project early if it doesn't have any formattable documents #1485
Conversation
2794f91 to
0caa94c
Compare
|
Can add tests if someone gives a thumbs-up for the approach. Didn't want to waste time adding tests before making sure what I am trying to do here makes sense |
0caa94c to
e029e7d
Compare
siriak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, waiting for it to be merged :)
|
@JoeRobich do you mind taking a look at this PR? I couldn't find a way to a request review directly |
|
@erdalsivri Thanks for opening this PR. I think this is a good change. We could probably even expand it so that we build an ImmutableArray up front and pass that into the Formatters so that even whitespace formatting could take advantage of this. |
Improves the runtime in large solutions when a small number of files is included (`--include`). This is a common use-case for developers to lint/format only modified files in their branch. In a solution with about 80 projects, this improves the runtime by about 50% when `--include SomeProject/SomeFile.cs` is specified. Related issues: dotnet#1378 and dotnet#757
e029e7d to
d61982d
Compare
Sounds good! There are few other small performance improvements I have been working on. May send a few more PRs your way. We'd really like to see I understand that running analyzers is slow because they require a build but not all style checks require a build. For example, "Add braces to 'if' statement" (https://docs.microsoft.com/pt-pt/dotnet/fundamentals/code-analysis/style-rules/ide0011) requires This is the output (cropped) of It even knows I have 3939 files in my solution but it doesn't need to. I guess that's why loading the workspace takes 30s. Even if we ignore the time spent on loading the workspace, formatting itself takes about 10 seconds. Anyways, maybe I should create a bug about these. There is probably not an easy fix for these though |
|
Looks like I don't have permission to merge even with an approval. @JoeRobich are you going to merge this one? |
Part of that is filesystem related. We have to query to find potential source files and applicable .editorconfig files. If you are seeing time being elsewhere, please open an issue and we can dig into it more.
We discussed internally building a workspace cache server or perhaps providing a way to rehydrate a workspace from a MSBuild Binary Log.
This is another enhancement that we've tossed around internally. Keeping a static list of diagnostics and fixers that can work from syntax and do not require semantic information. We are excited for this fix to get in. Thanks for submitting it. |
Yes,
Is there a bug/FR that I can follow? I can create one if not
That sounds good! Is there a bug/FR for this one?
|
Improves the runtime in large solutions when a small number of files is included (
--include). This is a common use-case for developers to lint/format only modified files in their branch.In a solution with about 80 projects, this improves the runtime by about 50% when
--include SomeProject/SomeFile.csis specified.Related issues: #1378 and #757