-
Notifications
You must be signed in to change notification settings - Fork 176
Types generated from .razor files are reported as missing #993
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
Hi @gavar, Thanks for using dotnet-format and giving us this feedback. As you have discovered, dotnet-format isn't able to fix all the issues it finds. This includes the built-in naming style analyzer as well as some third-party analyzers. We rely on the CodeFix providing a FixAll with Solution support. In the future we hope to enhance dotnet-format wiuth support for all CodeFixes.
The current behavior of dotnet-format is that it should return a non-zero exit code when any analyzer reports issues of the specified severity or higher. If you are seeing a different behavior, could you share a project that repros what you are seeing? |
Hi @JoeRobich, thank you for the quick reply. I've made a simple project describing the issue, hope you will find it helpful. |
@gavar Thanks for the excellent repro repo! =) I found the answer reading this blog post . The file globbing library that dotnet-format uses has problems with fully rooted paths. Passing the |
Thank you, I totally missed that, now it works great! BTW, whenever the I found same rule violation in #848 but it seems different |
@gavar In your case we have performed the restore prior to running dotnet-format. I see that the App class is generated from the App.razor file. It is likely that we are not invoking the proper MSBuild task when loading the workspace to add this class to our compilation. I am going to update this issue title to track this bug. |
Hi @JoeRobich, is there any updates on that? Can I help you with that? |
@gavar We recently merged #1128, which in hindsight may be the fix. Can you please try out the 6.0.235101 build of dotnet-format and let me know if it resolves your issue? You may need to add a NuGet.config file, since we haven't published a build to nuget.org yet. <?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<disabledPackageSources />
</configuration> |
Hi @JoeRobich I did update to 6.0.235101 but the same problem still exists
|
Hello and thank you for an amazing tool!
We're trying to enforce code conventions during commit hooks and
dotnet-format
helps perfectly.We've got troubles using new rules from Roslynator v3.1.0 introduced a new rule RCS0053 enforcing consistent indentation for lists which is the only rule I found doing so far.
By running
dotnet format -wsa warn
the following errors appears:Rules are working perfectly in VSCode / Intellij Rider, except of running via
dotnet format
. We could live with that by manually going though the code invoking the refactoring snippets, but I see thatdotnet format -wsa warn --check
bypass checks if there is no fix available assuming the code is fine.Is there any options to return non-zero code if
dotnet-format
unable see error but unable to fix so thatlint-staged
would fail?Thanks!
The text was updated successfully, but these errors were encountered: