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
193
193
# Remove unnecessary blank line.
194
194
dotnet_diagnostic.RCS0063.severity = warning
195
195
dotnet_diagnostic.RCS1036.severity = none # see https://github.com/dotnet/roslynator/issues/1632
196
+ # Remove redundant 'ToString' call.
197
+ dotnet_diagnostic.RCS1097.severity = warning
196
198
# Unnecessary null-forgiving operator.
197
199
dotnet_diagnostic.RCS1249.severity = warning
198
200
# Remove unnecessary braces.
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ public static DocumentNode PrintSchema(
93
93
var directiveTypeDefinitions =
94
94
schema . DirectiveTypes
95
95
. Where ( directive => ! builtInDirectives . Contains ( directive . Name ) )
96
- . OrderBy ( t => t . Name . ToString ( ) , StringComparer . Ordinal )
96
+ . OrderBy ( t => t . Name , StringComparer . Ordinal )
97
97
. Select ( PrintDirectiveTypeDefinition ) ;
98
98
99
99
typeDefinitions . AddRange ( directiveTypeDefinitions ) ;
@@ -102,7 +102,7 @@ public static DocumentNode PrintSchema(
102
102
schema . Types
103
103
. OfType < ScalarType > ( )
104
104
. Where ( t => includeSpecScalars || ! BuiltInTypes . IsBuiltInType ( t . Name ) )
105
- . OrderBy ( t => t . Name . ToString ( ) , StringComparer . Ordinal )
105
+ . OrderBy ( t => t . Name , StringComparer . Ordinal )
106
106
. Select ( PrintScalarType ) ;
107
107
108
108
typeDefinitions . AddRange ( scalarTypeDefinitions ) ;
@@ -115,7 +115,7 @@ private static IEnumerable<ITypeDefinition> GetNonScalarTypes(
115
115
{
116
116
return schema . Types
117
117
. Where ( IsPublicAndNoScalar )
118
- . OrderBy ( t => t . Name . ToString ( ) , StringComparer . Ordinal )
118
+ . OrderBy ( t => t . Name , StringComparer . Ordinal )
119
119
. GroupBy ( t => ( int ) t . Kind )
120
120
. OrderBy ( t => t . Key )
121
121
. SelectMany ( t => t ) ;
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public void Register_SchemaType_ClrTypeExists()
38
38
Assert . True ( exists ) ;
39
39
var fooType =
40
40
Assert . IsType < FooType > ( type . Type ) . Fields . ToDictionary (
41
- t => t . Name . ToString ( ) ,
41
+ t => t . Name ,
42
42
t => t . Type . Print ( ) ) ;
43
43
44
44
exists = typeRegistry . TryGetType (
@@ -48,7 +48,7 @@ public void Register_SchemaType_ClrTypeExists()
48
48
Assert . True ( exists ) ;
49
49
var barType =
50
50
Assert . IsType < BarType > ( type . Type ) . Fields . ToDictionary (
51
- t => t . Name . ToString ( ) ,
51
+ t => t . Name ,
52
52
t => t . Type . Print ( ) ) ;
53
53
54
54
new { fooType , barType } . MatchSnapshot ( ) ;
@@ -93,7 +93,7 @@ public void Register_ClrType_InferSchemaTypes()
93
93
Assert . True ( exists ) ;
94
94
var fooType =
95
95
Assert . IsType < ObjectType < Foo > > ( type . Type ) . Fields . ToDictionary (
96
- t => t . Name . ToString ( ) ,
96
+ t => t . Name ,
97
97
t => t . Type . Print ( ) ) ;
98
98
99
99
exists = typeRegistry . TryGetType (
@@ -103,7 +103,7 @@ public void Register_ClrType_InferSchemaTypes()
103
103
Assert . True ( exists ) ;
104
104
var barType =
105
105
Assert . IsType < ObjectType < Bar > > ( type . Type ) . Fields . ToDictionary (
106
- t => t . Name . ToString ( ) ,
106
+ t => t . Name ,
107
107
t => t . Type . Print ( ) ) ;
108
108
109
109
new { fooType , barType } . MatchSnapshot ( ) ;
You can’t perform that action at this time.
0 commit comments