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

feat: Allow treat Avalonia Access Unstable Private Apis Warning as Error #13937

Conversation

workgroupengineering
Copy link
Contributor

@workgroupengineering workgroupengineering commented Dec 13, 2023

What does the pull request do?

Allow treat Avalonia Access Unstable Private Apis Warning as Error

What is the current behavior?

When enable using Private Apis warning is show but ti can not be add at WarningsAsErrors

What is the updated/expected behavior with this PR?

I can add Avalonia Access Unstable Private Apis Warning as Error to WarningsAsErrors

How was the solution implemented (if it's not obvious)?

Add Warning code

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #13936

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.1.999-cibuild0042870-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@@ -21,6 +21,6 @@
<ReferencePath Include="$(MSBuildThisFileDirectory)/../lib/$(AvaloniaUnstableApiFrameworkToUse)/*.dll"/>
<ReferencePathWithRefAssemblies Include="$(MSBuildThisFileDirectory)/../lib/$(AvaloniaUnstableApiFrameworkToUse)/*.dll"/>
</ItemGroup>
<Warning Text="AvaloniaAccessUnstablePrivateApis is Enabled: This means you are using unstable internal APIs, and your code may be depending on APIs which may change or be removed in future versions of Avalonia. Set AvaloniaAccessUnstablePrivateApis to 'False' to disable this warning." />
<Warning Code="AVLN1002" Text="AvaloniaAccessUnstablePrivateApis is Enabled: This means you are using unstable internal APIs, and your code may be depending on APIs which may change or be removed in future versions of Avalonia. Set AvaloniaAccessUnstablePrivateApis to 'False' to disable this warning." />
Copy link
Member

@maxkatz6 maxkatz6 Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two problems here:

  1. AVLN prefix is used by the XAML compiler. We probably can change that to "AVX" as for "AValoniaXaml" before 11.1.
  2. Specifically AVLN1000 range is used by the XML parsing errors.

Avalonia property analyzer uses AVP0000 prefix.
Avalonia property name generator uses AXN0000 prefix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be another non-conflicting code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @maxkatz6
I chose this prefix because I believe it was related to XAML compiler. What prefix do you suggest?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think Private APIs warning is related to the XAML compiler. You can avoid XAML completely and still get this warning.

Seems like we also have a bit more generic codes: AVA2001

public const string DiagnosticId = "AVA2001";

Let's go with simple AVA3001 for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these codes should be documented later

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxkatz6 maxkatz6 added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Dec 14, 2023
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.1.999-cibuild0042889-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added this pull request to the merge queue Dec 14, 2023
Merged via the queue into AvaloniaUI:master with commit 9c94e92 Dec 14, 2023
6 checks passed
@workgroupengineering workgroupengineering deleted the features/Core/Treat-Warning-As-Errors-PriavteAPIs branch December 14, 2023 14:32
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Jan 17, 2024
maxkatz6 pushed a commit that referenced this pull request Jan 17, 2024
…ror (#13937)

* feat: Allow treat Avalonia Access Unstable Private Apis Warning as Error

* fix: Address review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Treat Avalonia Access Unstable Private Apis Warning as Error
3 participants