-
Notifications
You must be signed in to change notification settings - Fork 177
Analyzers that make changes to AdditionalFiles are not having their changes persisted #952
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
Comments
The ASP.NET team would very much like to see this, as we've adopted PublicAPI Analyzer, but if you're not in VS, it can be quite difficult to update the public API files, or when large changes are made (AspNetCore.sln is around 500 projects, so fix all can be a bit of a pain). |
Oh, nice! @dougbu we should try picking up the next release of |
Yup❕❕ The other fix I wanted to pick up was for #1192. @JoeRobich dotnet-roslyn-analyzers CI hasn't built since Thursday (for 'main') or Friday (for 'release/6.0.1xx'). Is that the right pipeline to watch❔ And, which branch should we be using❔ The current Microsoft.CodeAnalysis.PublicApiAnalyzers version in dotnet/aspnetcore is Ideal would be to get various fixes in our 'release/5.0' branch too. But, I seem to remember relying on non-stabilized versions in servicing branches causes problems. Does that mean we have to wait for a real |
Oops I got muddled this repo with roslyn-analyzers. @JoeRobich what's the correct way to invoke @Pilchie we don't automate |
@dougbu You can use our latest 5.1 build (5.1.222801) using the following command:
If you would like to specifically fix these PublicAPI issues, you can run the following command (Assumes the analyzers are added as package references to your projects):
Otherwise, you can run a more general command like the following to fix up whitespace, codestyle, and analyzer issues.
|
Unfortunately,
dotnet format .\AspNetCore.sln --fix-analyzers warn --no-restore --diagnostics=RS0016 or dotnet format .\AspNetCore.sln --fix-analyzers warn --no-restore or, to suppress a common dotnet format .\AspNetCore.sln --fix-analyzers warn --no-restore --diagnostics=RS0016 --verbosity diag Details of the crash
|
I can understand the tool tripping over our C++ projects but that doesn't seem related to the stack trace. Might be another bizarre Razor / Rosly / analyzers interaction here. Found a more narrow test case: dotnet format --fix-analyzers warn --no-restore src\Azure\AzureAD\Authentication.AzureAD.UI\src\Microsoft.AspNetCore.Authentication.AzureAD.UI.csproj results in the same stack trace as above. Working on traipsing through the many |
dir -recurse src\*.csproj |% FullName |? {$_ -like '*\src\*\src\*'} |% {if (sls -Quiet '<AddRazorSupportForMvc>true' $_) {echo "Skipping $_"} else {echo $_; dotnet format --fix-analyzers warn --no-restore $_}} gave me the above output (or something I'm unable to distinguish) for
The skipped projects were
Checking transitive references to the skipped three in the projects listed above… |
@dougbu The issue for dotnet-format is that we still target .NET Core 2.1 and do not have access to the AssemblyDependencyResolver. The SDK packaging for the Razor source generators no longer includes all dependencies in folder and instead relies on loading dependencies via a .deps.json. In the 6.x branch we intend to move to target .NET Core 3.1 which will make the resolver available to us. |
So, long story short, until that transition, we'll only be able to apply |
Analyzers such as the PublicApiAnalyzer will write updates to non-code files. We should support reporting and persisting these changes.
See dotnet/roslyn#48561 (comment)
The text was updated successfully, but these errors were encountered: