in theory this fixes all SA1649 issues now with any project with stylecop enabled (#5786)

This commit is contained in:
Clint Rutkas
2020-08-07 11:56:28 -07:00
committed by GitHub
parent 34c3b50b48
commit ada42f6e94
12 changed files with 157 additions and 169 deletions

View File

@@ -7,8 +7,6 @@ using System.Text.Json.Serialization;
namespace Microsoft.PowerToys.Settings.UI.Lib
{
#pragma warning disable SA1649 // File name should match first type name
public class GenericProperty<T>
{
[JsonPropertyName("value")]

View File

@@ -4,8 +4,6 @@
using System.Text.Json;
#pragma warning disable SA1649 // File name should match first type name
namespace Microsoft.PowerToys.Settings.UI.Lib
{
// Represents a powertoys module settings setnt to the runner.

View File

@@ -103,7 +103,7 @@
<Compile Include="Helpers\IThrottledActionInvoker.cs" />
<Compile Include="Helpers\ThrottledActionInvoker.cs" />
<Compile Include="Settings\IUserSettings.cs" />
<Compile Include="Settings\SettingItem.cs" />
<Compile Include="Settings\SettingItem`1.cs" />
<Compile Include="Settings\UserSettings.cs" />
<Compile Include="Telemetry\ColorPickerCancelledEvent.cs" />
<Compile Include="Telemetry\ColorPickerShowEvent.cs" />

View File

@@ -6,7 +6,6 @@ using System.ComponentModel;
namespace ColorPicker.Settings
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
public sealed class SettingItem<T> : INotifyPropertyChanged
{
private T _value;

View File

@@ -16,7 +16,6 @@ namespace Wox.Infrastructure.Storage
/// Storage object using binary data
/// Normally, it has better performance, but not readable
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
public class BinaryStorage<T> : IStorage<T>
{
// This storage helper returns whether or not to delete the binary storage items

View File

@@ -6,7 +6,6 @@ using System.Collections.Generic;
namespace Wox.Infrastructure.Storage
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
public interface IRepository<T>
{
void Add(T insertedItem);

View File

@@ -4,7 +4,6 @@
namespace Wox.Infrastructure.Storage
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
public interface IStorage<T>
{
/// <summary>

View File

@@ -13,7 +13,6 @@ namespace Wox.Infrastructure.Storage
/// <summary>
/// Serialize object using json format.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
public class JsonStorage<T>
{
private readonly JsonSerializerSettings _serializerSettings;

View File

@@ -16,7 +16,6 @@ namespace Wox.Infrastructure.Storage
/// of the data structure. Currently this is implemented as a list for it's simplicity.
/// </summary>
/// <typeparam name="T">typeof</typeparam>
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
public class ListRepository<T> : IRepository<T>, IEnumerable<T>
{
public IList<T> Items { get { return _items.Values.ToList(); } }

View File

@@ -6,7 +6,6 @@ using System.IO;
namespace Wox.Infrastructure.Storage
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
public class PluginJsonStorage<T> : JsonStorage<T> where T : new()
{
public PluginJsonStorage()

View File

@@ -6,7 +6,6 @@ using System.IO;
namespace Wox.Infrastructure.Storage
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Generic, file is named correctly")]
public class WoxJsonStorage<T> : JsonStorage<T> where T : new()
{
public WoxJsonStorage()