Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 02884f5

Browse files
authoredJul 8, 2021
Changed rulesets to reduce warning noise (#1486)
1 parent 0ddb607 commit 02884f5

12 files changed

+10
-23
lines changed
 

‎Xamarin.CommunityToolkit.ruleset

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
55
<Rule Id="SA0001" Action="None" />
66
<Rule Id="SA0002" Action="Warning" />
7-
<Rule Id="SA1000" Action="Warning" />
7+
<Rule Id="SA1000" Action="None" />
88
<Rule Id="SA1001" Action="Warning" />
99
<Rule Id="SA1002" Action="Warning" />
1010
<Rule Id="SA1003" Action="Warning" />
@@ -13,8 +13,9 @@
1313
<Rule Id="SA1006" Action="Warning" />
1414
<Rule Id="SA1007" Action="Warning" />
1515
<Rule Id="SA1008" Action="Warning" />
16-
<Rule Id="SA1009" Action="Warning" />
16+
<Rule Id="SA1009" Action="None" />
1717
<Rule Id="SA1010" Action="Warning" />
18+
<Rule Id="SA1011" Action="None" />
1819
<Rule Id="SA1012" Action="Warning" />
1920
<Rule Id="SA1013" Action="Warning" />
2021
<Rule Id="SA1014" Action="Warning" />
@@ -55,7 +56,7 @@
5556
<Rule Id="SA1120" Action="Warning" />
5657
<Rule Id="SA1121" Action="Warning" />
5758
<Rule Id="SA1122" Action="Warning" />
58-
<Rule Id="SA1123" Action="Warning" />
59+
<Rule Id="SA1123" Action="None" />
5960
<Rule Id="SA1124" Action="None" />
6061
<Rule Id="SA1125" Action="Warning" />
6162
<Rule Id="SA1126" Action="Warning" />
@@ -115,7 +116,6 @@
115116
<Rule Id="SA1409" Action="Warning" />
116117
<Rule Id="SA1410" Action="Warning" />
117118
<Rule Id="SA1411" Action="Warning" />
118-
<Rule Id="SA1412" Action="Warning" />
119119
<Rule Id="SA1413" Action="None" />
120120
<Rule Id="SA1500" Action="Warning" />
121121
<Rule Id="SA1501" Action="Warning" />

‎src/CommunityToolkit/Xamarin.CommunityToolkit/AssemblyInfo/AssemblyInfo.ios.tvos.watchos.macos.cs

+2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
using Xamarin.CommunityToolkit.UI.Views;
33
using Xamarin.Forms;
44

5+
#pragma warning disable CS0618 // Type or member is obsolete
56
[assembly: LinkerSafe]
7+
#pragma warning restore CS0618 // Type or member is obsolete
68

79
#if XAMARIN_IOS || XAMARIN_MAC
810
[assembly: ExportImageSourceHandler(typeof(GravatarImageSource), typeof(GravatarImageSourceHandler))]

‎src/CommunityToolkit/Xamarin.CommunityToolkit/Effects/Semantic/SemanticEffect.shared.cs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public static class SemanticEffect
1616

1717
public static void SetHeadingLevel(BindableObject view, HeadingLevel value) => view.SetValue(HeadingLevelProperty, value);
1818

19-
2019
public static readonly BindableProperty DescriptionProperty = BindableProperty.CreateAttached("Description", typeof(string), typeof(SemanticEffect), default(string), propertyChanged: OnPropertyChanged);
2120

2221
public static string GetDescription(BindableObject bindable) => (string)bindable.GetValue(DescriptionProperty);

‎src/CommunityToolkit/Xamarin.CommunityToolkit/Effects/Semantic/SemanticEffectRouterBase.android.cs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ protected override void OnAttached()
3131
}
3232
}
3333

34-
3534
protected virtual void Update(global::Android.Views.View view, T effect)
3635
{
3736
}

‎src/CommunityToolkit/Xamarin.CommunityToolkit/Effects/Touch/PlatformTouchEffect.uwp.cs

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ protected override void OnAttached()
5050
pointerDownStoryboard = new Storyboard();
5151
var downThemeAnimation = new PointerDownThemeAnimation();
5252

53-
5453
Storyboard.SetTargetName(downThemeAnimation, nativeControl.Name);
5554

5655
pointerDownStoryboard.Children.Add(downThemeAnimation);

‎src/CommunityToolkit/Xamarin.CommunityToolkit/Extensions/VisualElement/VisualElementExtensions.uwp.cs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ namespace Xamarin.CommunityToolkit.Extensions
99
/// </summary>
1010
public static partial class VisualElementExtensions
1111
{
12-
1312
/// <summary>
1413
/// <see cref="VisualElement"/> cleanup object to dispose and
1514
/// destroy resources.

‎src/CommunityToolkit/Xamarin.CommunityToolkit/Views/CameraView/Android/CameraFragment.android.cs

-10
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
using System.Linq;
3636
using Xamarin.Forms;
3737
using Xamarin.Forms.Platform.Android;
38-
using Camera = Android.Hardware.Camera;
39-
using Math = System.Math;
4038
using Rect = Android.Graphics.Rect;
4139
using APoint = Android.Graphics.Point;
4240

@@ -541,8 +539,6 @@ public async Task StopRecord()
541539
{
542540
LogError("Error restarting video recording", ex);
543541
}
544-
545-
546542
}
547543

548544
async Task PrepareSession()
@@ -783,7 +779,6 @@ public void ApplyZoom()
783779
};
784780
}
785781

786-
#region TextureView.ISurfaceTextureListener
787782
async void TextureView.ISurfaceTextureListener.OnSurfaceTextureAvailable(SurfaceTexture? surface, int width, int height)
788783
{
789784
UpdateBackgroundColor();
@@ -803,9 +798,7 @@ bool TextureView.ISurfaceTextureListener.OnSurfaceTextureDestroyed(SurfaceTextur
803798
void TextureView.ISurfaceTextureListener.OnSurfaceTextureUpdated(SurfaceTexture? surface)
804799
{
805800
}
806-
#endregion
807801

808-
#region Permissions
809802
async Task RequestCameraPermissions()
810803
{
811804
if (permissionsRequested != null)
@@ -856,9 +849,7 @@ public override void OnRequestPermissionsResult(int requestCode, string[] permis
856849
}
857850
permissionsRequested?.TrySetResult(true);
858851
}
859-
#endregion
860852

861-
#region Helpers
862853
void LogError(string desc, Java.Lang.Exception? ex = null)
863854
{
864855
var newLine = System.Environment.NewLine;
@@ -1069,6 +1060,5 @@ ASize ChooseOptimalSize(ASize[] choices, int width, int height, int maxWidth, in
10691060
LogError("Couldn't find any suitable preview size");
10701061
return choices[0];
10711062
}
1072-
#endregion
10731063
}
10741064
}

‎src/CommunityToolkit/Xamarin.CommunityToolkit/Views/MediaElement/WPF/MediaElementRenderer.wpf.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ protected override void OnElementChanged(ElementChangedEventArgs<ToolKitMediaEle
5454

5555
Control.Stretch = Element.Aspect.ToStretch();
5656

57-
5857
Element.SeekRequested += SeekRequested;
5958
Element.StateRequested += StateRequested;
6059
Element.PositionRequested += PositionRequested;
@@ -73,6 +72,7 @@ void PositionRequested(object? sender, EventArgs e)
7372
}
7473

7574
MediaElementState requestedState;
75+
7676
IMediaElementController Controller => Element as IMediaElementController;
7777

7878
void StateRequested(object? sender, StateRequested e)

‎src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Popup/UWP/PopupRenderer.uwp.cs

-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ void SetEvents()
120120
Opened += OnOpened;
121121
}
122122

123-
124-
125123
void SetSize()
126124
{
127125
_ = Element ?? throw new InvalidOperationException($"{nameof(Element)} cannot be null");

‎src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Shield.shared.cs

+2
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ protected override void OnPropertyChanged([CallerMemberName] string propertyName
314314

315315
void UpdateSubjectColor() => ShieldSubjectContainer.BackgroundColor = SubjectBackgroundColor;
316316

317+
#pragma warning disable CS0618 // Type or member is obsolete
317318
void UpdateColor() => ShieldStatusContainer.BackgroundColor = Color;
319+
#pragma warning restore CS0618 // Type or member is obsolete
318320

319321
void UpdateStatusBackgroundColor() => ShieldStatusContainer.BackgroundColor = StatusBackgroundColor;
320322

‎src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Snackbar/Helpers/NativeRoundedStackView.ios.macos.cs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using Xamarin.CommunityToolkit.UI.Views.Helpers.iOS;
88
using UIKit;
99
#elif __MACOS__
10-
using CoreGraphics;
1110
using Xamarin.CommunityToolkit.UI.Views.Helpers.macOS;
1211
using Xamarin.CommunityToolkit.UI.Views.Helpers.macOS.Extensions;
1312
using AppKit;

‎src/CommunityToolkit/Xamarin.CommunityToolkit/Xamarin.CommunityToolkit.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<Configurations>Debug;Release</Configurations>
3232
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
3333
<DebugType>portable</DebugType>
34-
<NoWarn>SA1123</NoWarn>
34+
<NoWarn>NU1701</NoWarn>
3535
</PropertyGroup>
3636
<PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
3737
<!-- Manage TargetFrameworks for development (Debug Mode) -->

0 commit comments

Comments
 (0)
This repository has been archived.