-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: Allow treat Avalonia Access Unstable Private Apis Warning as Error #13937
Conversation
You can test this PR using the following package version. |
@@ -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." /> |
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.
Two problems here:
- AVLN prefix is used by the XAML compiler. We probably can change that to "AVX" as for "AValoniaXaml" before 11.1.
- Specifically AVLN1000 range is used by the XML parsing errors.
Avalonia/src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/AvaloniaXamlDiagnosticCodes.cs
Line 14 in 73f7fd1
public const string InvalidXAML = "AVLN1001";
Avalonia property analyzer uses AVP0000 prefix.
Avalonia property name generator uses AXN0000 prefix.
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.
There should be another non-conflicting code
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.
Hi, @maxkatz6
I chose this prefix because I believe it was related to XAML compiler. What prefix do you suggest?
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.
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.
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.
All of these codes should be documented later
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.
You can test this PR using the following package version. |
…ror (#13937) * feat: Allow treat Avalonia Access Unstable Private Apis Warning as Error * fix: Address review
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