File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
test/Types.Tests/Configuration Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,8 @@ dotnet_style_prefer_collection_expression = when_types_exactly_match
193193# Remove unnecessary blank line.
194194dotnet_diagnostic.RCS0063.severity = warning
195195dotnet_diagnostic.RCS1036.severity = none # see https://github.com/dotnet/roslynator/issues/1632
196+ # Remove redundant 'ToString' call.
197+ dotnet_diagnostic.RCS1097.severity = warning
196198# Unnecessary null-forgiving operator.
197199dotnet_diagnostic.RCS1249.severity = warning
198200# Remove unnecessary braces.
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ public static DocumentNode PrintSchema(
9393 var directiveTypeDefinitions =
9494 schema . DirectiveTypes
9595 . Where ( directive => ! builtInDirectives . Contains ( directive . Name ) )
96- . OrderBy ( t => t . Name . ToString ( ) , StringComparer . Ordinal )
96+ . OrderBy ( t => t . Name , StringComparer . Ordinal )
9797 . Select ( PrintDirectiveTypeDefinition ) ;
9898
9999 typeDefinitions . AddRange ( directiveTypeDefinitions ) ;
@@ -102,7 +102,7 @@ public static DocumentNode PrintSchema(
102102 schema . Types
103103 . OfType < ScalarType > ( )
104104 . Where ( t => includeSpecScalars || ! BuiltInTypes . IsBuiltInType ( t . Name ) )
105- . OrderBy ( t => t . Name . ToString ( ) , StringComparer . Ordinal )
105+ . OrderBy ( t => t . Name , StringComparer . Ordinal )
106106 . Select ( PrintScalarType ) ;
107107
108108 typeDefinitions . AddRange ( scalarTypeDefinitions ) ;
@@ -115,7 +115,7 @@ private static IEnumerable<ITypeDefinition> GetNonScalarTypes(
115115 {
116116 return schema . Types
117117 . Where ( IsPublicAndNoScalar )
118- . OrderBy ( t => t . Name . ToString ( ) , StringComparer . Ordinal )
118+ . OrderBy ( t => t . Name , StringComparer . Ordinal )
119119 . GroupBy ( t => ( int ) t . Kind )
120120 . OrderBy ( t => t . Key )
121121 . SelectMany ( t => t ) ;
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public void Register_SchemaType_ClrTypeExists()
3838 Assert . True ( exists ) ;
3939 var fooType =
4040 Assert . IsType < FooType > ( type . Type ) . Fields . ToDictionary (
41- t => t . Name . ToString ( ) ,
41+ t => t . Name ,
4242 t => t . Type . Print ( ) ) ;
4343
4444 exists = typeRegistry . TryGetType (
@@ -48,7 +48,7 @@ public void Register_SchemaType_ClrTypeExists()
4848 Assert . True ( exists ) ;
4949 var barType =
5050 Assert . IsType < BarType > ( type . Type ) . Fields . ToDictionary (
51- t => t . Name . ToString ( ) ,
51+ t => t . Name ,
5252 t => t . Type . Print ( ) ) ;
5353
5454 new { fooType , barType } . MatchSnapshot ( ) ;
@@ -93,7 +93,7 @@ public void Register_ClrType_InferSchemaTypes()
9393 Assert . True ( exists ) ;
9494 var fooType =
9595 Assert . IsType < ObjectType < Foo > > ( type . Type ) . Fields . ToDictionary (
96- t => t . Name . ToString ( ) ,
96+ t => t . Name ,
9797 t => t . Type . Print ( ) ) ;
9898
9999 exists = typeRegistry . TryGetType (
@@ -103,7 +103,7 @@ public void Register_ClrType_InferSchemaTypes()
103103 Assert . True ( exists ) ;
104104 var barType =
105105 Assert . IsType < ObjectType < Bar > > ( type . Type ) . Fields . ToDictionary (
106- t => t . Name . ToString ( ) ,
106+ t => t . Name ,
107107 t => t . Type . Print ( ) ) ;
108108
109109 new { fooType , barType } . MatchSnapshot ( ) ;
You can’t perform that action at this time.
0 commit comments