You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From @dude3133 on Friday, January 13, 2023 3:25:04 PM
Description
Using StyleCop with rules Action="Error" produce unexpected compile errors from autogenerated code and used libraries
For example:
Using StyleCop.Analyzers.ruleset with: <Rule Id="SA1505" Action="Error" />
Produces errors:
/Droid/obj/Debug/net6.0-android/generated/src/Java.Interop.__TypeRegistrations.cs(24,24): Error SA1505: An opening brace should not be followed by a blank line (SA1505)
/Droid/obj/Debug/net6.0-android/generated/src/Com.Android.Installreferrer.Commons.InstallReferrerCommons.cs(47,47): Error SA1505: An opening brace should not be followed by a blank line (SA1505)
StyleCop provide option with ignoring all errors and warnings using // <auto-generated/> comment. And I found one ticket that refers their logic to avoid generated code: DotNetAnalyzers/StyleCopAnalyzers#1430
Could we somehow add // <auto-generated/> comment for all generated code under obj/ folder?
Steps to Reproduce
Create any net6-android project
Add SonarCop with more rules (like SA1505, SA1507) as Error
Try to build
Link to public reproduction project repository
Version with bug
6.0.312
Last version that worked well
6.0.312
Affected platforms
Android
Affected platform versions
Android Any
Did you find any workaround?
Remove SonarCop? Live without clean code? Nope
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
Issue moved from dotnet/maui#12638
From @dude3133 on Friday, January 13, 2023 3:25:04 PM
Description
Using StyleCop with rules
Action="Error"
produce unexpected compile errors from autogenerated code and used librariesFor example:
Using StyleCop.Analyzers.ruleset with:
<Rule Id="SA1505" Action="Error" />
Produces errors:
StyleCop provide option with ignoring all errors and warnings using
// <auto-generated/>
comment. And I found one ticket that refers their logic to avoid generated code: DotNetAnalyzers/StyleCopAnalyzers#1430Could we somehow add
// <auto-generated/>
comment for all generated code under obj/ folder?Steps to Reproduce
Link to public reproduction project repository
Version with bug
6.0.312
Last version that worked well
6.0.312
Affected platforms
Android
Affected platform versions
Android Any
Did you find any workaround?
Remove SonarCop? Live without clean code? Nope
Relevant log output
No response
The text was updated successfully, but these errors were encountered: