-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #248 from stanriders/update-configs
- Loading branch information
Showing
43 changed files
with
496 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
# EditorConfig is awesome: http://editorconfig.org | ||
root = true | ||
|
||
[*.{csproj,props,targets}] | ||
charset = utf-8-bom | ||
end_of_line = crlf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
trim_trailing_whitespace = true | ||
|
||
[g_*.cs] | ||
generated_code = true | ||
|
||
[*.cs] | ||
end_of_line = crlf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
#license header | ||
file_header_template = Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.\nSee the LICENCE file in the repository root for full licence text. | ||
|
||
#Roslyn naming styles | ||
|
||
#PascalCase for public and protected members | ||
|
@@ -121,7 +135,7 @@ dotnet_style_qualification_for_event = false:warning | |
dotnet_style_predefined_type_for_locals_parameters_members = true:warning | ||
dotnet_style_predefined_type_for_member_access = true:warning | ||
csharp_style_var_when_type_is_apparent = true:none | ||
csharp_style_var_for_built_in_types = true:none | ||
csharp_style_var_for_built_in_types = false:warning | ||
csharp_style_var_elsewhere = true:silent | ||
|
||
#Style - modifiers | ||
|
@@ -165,7 +179,7 @@ csharp_style_unused_value_assignment_preference = discard_variable:warning | |
|
||
#Style - variable declaration | ||
csharp_style_inlined_variable_declaration = true:warning | ||
csharp_style_deconstructed_variable_declaration = true:warning | ||
csharp_style_deconstructed_variable_declaration = false:silent | ||
|
||
#Style - other C# 7.x features | ||
dotnet_style_prefer_inferred_tuple_names = true:warning | ||
|
@@ -176,19 +190,20 @@ dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent | |
#Style - C# 8 features | ||
csharp_prefer_static_local_function = true:warning | ||
csharp_prefer_simple_using_statement = true:silent | ||
csharp_style_prefer_index_operator = true:warning | ||
csharp_style_prefer_range_operator = true:warning | ||
csharp_style_prefer_index_operator = false:silent | ||
csharp_style_prefer_range_operator = false:silent | ||
csharp_style_prefer_switch_expression = false:none | ||
|
||
#Supressing roslyn built-in analyzers | ||
# Suppress: EC112 | ||
csharp_style_namespace_declarations = block_scoped:warning | ||
|
||
#Style - C# 12 features | ||
csharp_style_prefer_primary_constructors = false | ||
|
||
#Private method is unused | ||
dotnet_diagnostic.IDE0051.severity = silent | ||
#Private member is unused | ||
dotnet_diagnostic.IDE0052.severity = silent | ||
[*.{yaml,yml}] | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
trim_trailing_whitespace = true | ||
|
||
#Rules for disposable | ||
dotnet_diagnostic.IDE0067.severity = none | ||
dotnet_diagnostic.IDE0068.severity = none | ||
dotnet_diagnostic.IDE0069.severity = none | ||
dotnet_diagnostic.OLOC001.words_in_name = 5 | ||
dotnet_diagnostic.OLOC001.license_header = // Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.\n// See the LICENCE file in the repository root for full licence text. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
M:System.Object.Equals(System.Object,System.Object)~System.Boolean;Don't use object.Equals. Use IEquatable<T> or EqualityComparer<T>.Default instead. | ||
M:System.Object.Equals(System.Object)~System.Boolean;Don't use object.Equals. Use IEquatable<T> or EqualityComparer<T>.Default instead. | ||
M:System.ValueType.Equals(System.Object)~System.Boolean;Don't use object.Equals(Fallbacks to ValueType). Use IEquatable<T> or EqualityComparer<T>.Default instead. | ||
M:System.Nullable`1.Equals(System.Object)~System.Boolean;Use == instead. | ||
T:System.IComparable;Don't use non-generic IComparable. Use generic version instead. | ||
T:SixLabors.ImageSharp.IDeepCloneable`1;Use osu.Game.Utils.IDeepCloneable<T> instead. | ||
M:osu.Framework.Graphics.Sprites.SpriteText.#ctor;Use OsuSpriteText. | ||
M:osu.Framework.Bindables.IBindableList`1.GetBoundCopy();Fails on iOS. Use manual ctor + BindTo instead. (see https://github.com/mono/mono/issues/19900) | ||
T:NuGet.Packaging.CollectionExtensions;Don't use internal extension methods. | ||
M:Realms.IRealmCollection`1.SubscribeForNotifications`1(Realms.NotificationCallbackDelegate{``0});Use osu.Game.Database.RealmObjectExtensions.QueryAsyncWithNotifications(IRealmCollection<T>,NotificationCallbackDelegate<T>) instead. | ||
M:System.Guid.#ctor;Probably meaning to use Guid.NewGuid() instead. If actually wanting empty, use Guid.Empty. | ||
M:Realms.CollectionExtensions.SubscribeForNotifications`1(System.Linq.IQueryable{``0},Realms.NotificationCallbackDelegate{``0});Use osu.Game.Database.RealmObjectExtensions.QueryAsyncWithNotifications(IQueryable<T>,NotificationCallbackDelegate<T>) instead. | ||
M:Realms.CollectionExtensions.SubscribeForNotifications`1(System.Collections.Generic.IList{``0},Realms.NotificationCallbackDelegate{``0});Use osu.Game.Database.RealmObjectExtensions.QueryAsyncWithNotifications(IList<T>,NotificationCallbackDelegate<T>) instead. | ||
M:System.Threading.Tasks.Task.Wait();Don't use Task.Wait. Use Task.WaitSafely() to ensure we avoid deadlocks. | ||
P:System.Threading.Tasks.Task`1.Result;Don't use Task.Result. Use Task.GetResultSafely() to ensure we avoid deadlocks. | ||
M:System.Threading.ManualResetEventSlim.Wait();Specify a timeout to avoid waiting forever. | ||
M:Humanizer.InflectorExtensions.Pascalize(System.String);Humanizer's .Pascalize() extension method changes behaviour depending on CultureInfo.CurrentCulture. Use StringDehumanizeExtensions.ToPascalCase() instead. | ||
M:Humanizer.InflectorExtensions.Camelize(System.String);Humanizer's .Camelize() extension method changes behaviour depending on CultureInfo.CurrentCulture. Use StringDehumanizeExtensions.ToCamelCase() instead. | ||
M:Humanizer.InflectorExtensions.Underscore(System.String);Humanizer's .Underscore() extension method changes behaviour depending on CultureInfo.CurrentCulture. Use StringDehumanizeExtensions.ToSnakeCase() instead. | ||
M:Humanizer.InflectorExtensions.Kebaberize(System.String);Humanizer's .Kebaberize() extension method changes behaviour depending on CultureInfo.CurrentCulture. Use StringDehumanizeExtensions.ToKebabCase() instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# .NET Code Style | ||
# IDE styles reference: https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ | ||
is_global = true | ||
|
||
# IDE0001: Simplify names | ||
dotnet_diagnostic.IDE0001.severity = warning | ||
|
||
# IDE0002: Simplify member access | ||
dotnet_diagnostic.IDE0002.severity = warning | ||
|
||
# IDE0003: Remove qualification | ||
dotnet_diagnostic.IDE0003.severity = warning | ||
|
||
# IDE0004: Remove unnecessary cast | ||
dotnet_diagnostic.IDE0004.severity = warning | ||
|
||
# IDE0005: Remove unnecessary imports | ||
dotnet_diagnostic.IDE0005.severity = warning | ||
|
||
# IDE0034: Simplify default literal | ||
dotnet_diagnostic.IDE0034.severity = warning | ||
|
||
# IDE0036: Sort modifiers | ||
dotnet_diagnostic.IDE0036.severity = warning | ||
|
||
# IDE0040: Add accessibility modifier | ||
dotnet_diagnostic.IDE0040.severity = warning | ||
|
||
# IDE0049: Use keyword for type name | ||
dotnet_diagnostic.IDE0040.severity = warning | ||
|
||
# IDE0055: Fix formatting | ||
dotnet_diagnostic.IDE0055.severity = warning | ||
|
||
# IDE0051: Private method is unused | ||
dotnet_diagnostic.IDE0051.severity = silent | ||
|
||
# IDE0052: Private member is unused | ||
dotnet_diagnostic.IDE0052.severity = silent | ||
|
||
# IDE0073: File header | ||
dotnet_diagnostic.IDE0073.severity = warning | ||
|
||
# IDE0130: Namespace mismatch with folder | ||
dotnet_diagnostic.IDE0130.severity = warning | ||
|
||
# IDE1006: Naming style | ||
dotnet_diagnostic.IDE1006.severity = warning | ||
|
||
# CA1305: Specify IFormatProvider | ||
# Too many noisy warnings for parsing/formatting numbers | ||
dotnet_diagnostic.CA1305.severity = none | ||
|
||
# CA1507: Use nameof to express symbol names | ||
# Flaggs serialization name attributes | ||
dotnet_diagnostic.CA1507.severity = suggestion | ||
|
||
# CA1806: Do not ignore method results | ||
# The usages for numeric parsing are explicitly optional | ||
dotnet_diagnostic.CA1806.severity = suggestion | ||
|
||
# CA1822: Mark members as static | ||
# Potential false positive around reflection/too much noise | ||
dotnet_diagnostic.CA1822.severity = none | ||
|
||
# CA1826: Do not use Enumerable method on indexable collections | ||
dotnet_diagnostic.CA1826.severity = suggestion | ||
|
||
# CA1859: Use concrete types when possible for improved performance | ||
# Involves design considerations | ||
dotnet_diagnostic.CA1859.severity = suggestion | ||
|
||
# CA1860: Avoid using 'Enumerable.Any()' extension method | ||
dotnet_diagnostic.CA1860.severity = suggestion | ||
|
||
# CA1861: Avoid constant arrays as arguments | ||
# Outdated with collection expressions | ||
dotnet_diagnostic.CA1861.severity = suggestion | ||
|
||
# CA2007: Consider calling ConfigureAwait on the awaited task | ||
dotnet_diagnostic.CA2007.severity = warning | ||
|
||
# CA2016: Forward the 'CancellationToken' parameter to methods | ||
# Some overloads are having special handling for debugger | ||
dotnet_diagnostic.CA2016.severity = suggestion | ||
|
||
# CA2021: Do not call Enumerable.Cast<T> or Enumerable.OfType<T> with incompatible types | ||
# Causing a lot of false positives with generics | ||
dotnet_diagnostic.CA2021.severity = none | ||
|
||
# CA2101: Specify marshaling for P/Invoke string arguments | ||
# Reports warning for all non-UTF16 usages on DllImport; consider migrating to LibraryImport | ||
dotnet_diagnostic.CA2101.severity = none | ||
|
||
# CA2201: Do not raise reserved exception types | ||
dotnet_diagnostic.CA2201.severity = warning | ||
|
||
# CA2208: Instantiate argument exceptions correctly | ||
dotnet_diagnostic.CA2208.severity = suggestion | ||
|
||
# CA2242: Test for NaN correctly | ||
dotnet_diagnostic.CA2242.severity = warning | ||
|
||
# Banned APIs | ||
dotnet_diagnostic.RS0030.severity = error | ||
|
||
# Temporarily disable analysing CanBeNull = true in NRT contexts due to mobile issues. | ||
# See: https://github.com/ppy/osu/pull/19677 | ||
dotnet_diagnostic.OSUF001.severity = none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.