Skip to content

Commit

Permalink
treat warnings as errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Miller committed Oct 5, 2024
1 parent 9a166e4 commit 9576d8a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<WarningLevel>9999</WarningLevel>
<AnalysisLevel>latest-all</AnalysisLevel>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
Expand Down
2 changes: 2 additions & 0 deletions Maui.DataGrid.Sample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace Maui.DataGrid.Sample;

#pragma warning disable CA1724

/// <summary>
/// Codebehind for the App.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions Maui.DataGrid.Sample/Converters/StreakToColorConverter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
namespace Maui.DataGrid.Sample.Converters;

using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using Maui.DataGrid.Sample.Models;

[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Instantiated via XAML")]
internal sealed class StreakToColorConverter : IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
Expand Down
2 changes: 2 additions & 0 deletions Maui.DataGrid/Collections/ObservableRangeCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ namespace Maui.DataGrid.Collections;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;

/// <summary>
/// Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.
/// </summary>
/// <typeparam name="T">The object type of elements in the collection.</typeparam>
[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Instantiated via collection expression")]
internal sealed class ObservableRangeCollection<T> : ObservableCollection<T>
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Maui.DataGrid/DataGrid.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace Maui.DataGrid;
using Microsoft.Maui.Controls.Shapes;
using Font = Microsoft.Maui.Font;

#pragma warning disable CA1724

/// <summary>
/// DataGrid component for .NET MAUI.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions Maui.DataGrid/DataGridHeaderRow.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
namespace Maui.DataGrid;

using System.Diagnostics.CodeAnalysis;
using Maui.DataGrid.Extensions;
using Microsoft.Maui.Controls;

[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Instantiated via XAML")]
internal sealed class DataGridHeaderRow : Grid
{
#region Bindable Properties
Expand Down
2 changes: 2 additions & 0 deletions Maui.DataGrid/DataGridRow.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
namespace Maui.DataGrid;

using System.Diagnostics.CodeAnalysis;
using Maui.DataGrid.Extensions;
using Microsoft.Maui.Controls;

[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Instantiated via XAML")]
internal sealed class DataGridRow : Grid
{
#region Bindable Properties
Expand Down
1 change: 1 addition & 0 deletions Maui.DataGrid/Maui.DataGrid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)">
<PrivateAssets>all</PrivateAssets>
Expand Down

0 comments on commit 9576d8a

Please sign in to comment.