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 namespace Microsoft.PowerToys.Settings.UI.Lib
{ {
#pragma warning disable SA1649 // File name should match first type name
public class GenericProperty<T> public class GenericProperty<T>
{ {
[JsonPropertyName("value")] [JsonPropertyName("value")]

View File

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

View File

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

View File

@@ -6,7 +6,6 @@ using System.ComponentModel;
namespace ColorPicker.Settings 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 public sealed class SettingItem<T> : INotifyPropertyChanged
{ {
private T _value; private T _value;

View File

@@ -16,7 +16,6 @@ namespace Wox.Infrastructure.Storage
/// Storage object using binary data /// Storage object using binary data
/// Normally, it has better performance, but not readable /// Normally, it has better performance, but not readable
/// </summary> /// </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> public class BinaryStorage<T> : IStorage<T>
{ {
// This storage helper returns whether or not to delete the binary storage items // 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 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> public interface IRepository<T>
{ {
void Add(T insertedItem); void Add(T insertedItem);

View File

@@ -4,7 +4,6 @@
namespace Wox.Infrastructure.Storage 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> public interface IStorage<T>
{ {
/// <summary> /// <summary>

View File

@@ -13,7 +13,6 @@ namespace Wox.Infrastructure.Storage
/// <summary> /// <summary>
/// Serialize object using json format. /// Serialize object using json format.
/// </summary> /// </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> public class JsonStorage<T>
{ {
private readonly JsonSerializerSettings _serializerSettings; 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. /// of the data structure. Currently this is implemented as a list for it's simplicity.
/// </summary> /// </summary>
/// <typeparam name="T">typeof</typeparam> /// <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 class ListRepository<T> : IRepository<T>, IEnumerable<T>
{ {
public IList<T> Items { get { return _items.Values.ToList(); } } public IList<T> Items { get { return _items.Values.ToList(); } }

View File

@@ -6,7 +6,6 @@ using System.IO;
namespace Wox.Infrastructure.Storage 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 class PluginJsonStorage<T> : JsonStorage<T> where T : new()
{ {
public PluginJsonStorage() public PluginJsonStorage()

View File

@@ -6,7 +6,6 @@ using System.IO;
namespace Wox.Infrastructure.Storage 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 class WoxJsonStorage<T> : JsonStorage<T> where T : new()
{ {
public WoxJsonStorage() public WoxJsonStorage()