Skip to content

Commit 636be09

Browse files
authored
Set CA1507 to Warning and fix instances of errors (#7176)
* Set CA1507 to Warning and fix instances of errors * Revert ruleset changes * Change CA1507 to warning
1 parent dd6848b commit 636be09

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

eng/Common.globalconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ dotnet_diagnostic.CA1505.severity = none
200200
dotnet_diagnostic.CA1506.severity = none
201201

202202
# Use nameof to express symbol names
203-
dotnet_diagnostic.CA1507.severity = suggestion
203+
dotnet_diagnostic.CA1507.severity = warning
204204

205205
# Avoid dead conditional code
206206
dotnet_diagnostic.CA1508.severity = none

src/Shared/ToolsetElement.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public string toolsVersion
134134
{
135135
get
136136
{
137-
return (string)base["toolsVersion"];
137+
return (string)base[nameof(toolsVersion)];
138138
}
139139

140140
set
@@ -740,7 +740,7 @@ public string DefaultOverrideToolsVersion
740740
// whenever the base class gives us an empty string.
741741
// Note this means we can't distinguish between the attribute being present but containing
742742
// an empty string for its value and the attribute not being present at all.
743-
string defaultValue = (string)base["DefaultOverrideToolsVersion"];
743+
string defaultValue = (string)base[nameof(DefaultOverrideToolsVersion)];
744744
return String.IsNullOrEmpty(defaultValue) ? null : defaultValue;
745745
}
746746

0 commit comments

Comments
 (0)