Skip to content
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

Source files should either be marked as auto-generated or at least suppress formatting warnings #174

Open
10 tasks
Youssef1313 opened this issue May 7, 2024 · 2 comments
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@Youssef1313
Copy link
Member

Current behavior

The HRApp in Uno runtime tests is using the runtimetests engine package and the app builds with formatting warnings:

[5/7/2024 9:48:15 AM] HRAppBuild: C:\Users\VssAdministrator\.nuget\packages\uno.ui.runtimetests.engine\0.15.0-dev.56\src\Library\InputInjectorHelper.cs(18,1): warning IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\HotReload\Frame\HRApp\Uno.UI.RuntimeTests.HRApp.Skia.Gtk.csproj]
[5/7/2024 9:48:15 AM] HRAppBuild: C:\Users\VssAdministrator\.nuget\packages\uno.ui.runtimetests.engine\0.15.0-dev.56\src\Library\InputInjectorHelper.cs(20,1): warning IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\HotReload\Frame\HRApp\Uno.UI.RuntimeTests.HRApp.Skia.Gtk.csproj]
[5/7/2024 9:48:15 AM] HRAppBuild: C:\Users\VssAdministrator\.nuget\packages\uno.ui.runtimetests.engine\0.15.0-dev.56\src\Library\InputInjectorHelper.cs(21,1): warning IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\HotReload\Frame\HRApp\Uno.UI.RuntimeTests.HRApp.Skia.Gtk.csproj]
[5/7/2024 9:48:15 AM] HRAppBuild: C:\Users\VssAdministrator\.nuget\packages\uno.ui.runtimetests.engine\0.15.0-dev.56\src\Library\InputInjectorHelper.cs(22,1): warning IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\HotReload\Frame\HRApp\Uno.UI.RuntimeTests.HRApp.Skia.Gtk.csproj]
[5/7/2024 9:48:15 AM] HRAppBuild: C:\Users\VssAdministrator\.nuget\packages\uno.ui.runtimetests.engine\0.15.0-dev.56\src\Library\InputInjectorHelper.cs(23,1): warning IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\HotReload\Frame\HRApp\Uno.UI.RuntimeTests.HRApp.Skia.Gtk.csproj]
[5/7/2024 9:48:15 AM] HRAppBuild: C:\Users\VssAdministrator\.nuget\packages\uno.ui.runtimetests.engine\0.15.0-dev.56\src\Library\InputInjectorHelper.cs(25,1): warning IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\HotReload\Frame\HRApp\Uno.UI.RuntimeTests.HRApp.Skia.Gtk.csproj]
[5/7/2024 9:48:15 AM] HRAppBuild: C:\Users\VssAdministrator\.nuget\packages\uno.ui.runtimetests.engine\0.15.0-dev.56\src\Library\InputInjectorHelper.cs(26,1): warning IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\HotReload\Frame\HRApp\Uno.UI.RuntimeTests.HRApp.Skia.Gtk.csproj]
[5/7/2024 9:48:15 AM] HRAppBuild: C:\Users\VssAdministrator\.nuget\packages\uno.ui.runtimetests.engine\0.15.0-dev.56\src\Library\InputInjectorHelper.cs(27,1): warning IDE0055: Fix formatting (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055) [D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\HotReload\Frame\HRApp\Uno.UI.RuntimeTests.HRApp.Skia.Gtk.csproj]

Expected behavior

NOTE: We don't know what formatting rules are set by the consuming apps, so fixing formatting warnings isn't possible. Instead, we should have #pragma warning disable IDE0055 or have // <auto-generated> tag at the top.

How to reproduce it (as minimally and precisely as possible)

Environment

Nuget Package:

Package Version(s):

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renders for Xamarin.Forms
  • Windows
  • Build tasks

Visual Studio:

  • 2017 (version: )
  • 2019 (version: )
  • for Mac (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

@Youssef1313 Youssef1313 added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels May 7, 2024
@dansiegel
Copy link

If we cannot pre-compile this then autogenerated is probably best since we have no idea what additional analyzers may be present where autogenerated excludes the file from all of these additional analyzers which means you won't get warnings/errors for things like formatting or nullability, etc.

@Youssef1313
Copy link
Member Author

@dansiegel Just came across a nullability error after upgrading MSTest

[5/7/2024 10:32:46 AM] HRAppBuild: C:\Users\VssAdministrator.nuget\packages\uno.ui.runtimetests.engine\0.15.0-dev.56\src\UI\UnitTestMethodInfo.cs(94,43): error CS8619: Nullability of reference types in value of type 'object?[]' doesn't match target type 'object[]'. [D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\HotReload\Frame\HRApp\Uno.UI.RuntimeTests.HRApp.Skia.Gtk.csproj]

So indeed, suppressing only formatting warnings isn't going to work very well. For now we'll need to have // <auto-generated>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

No branches or pull requests

2 participants