This commit is contained in:
Jamie Magee 2022-10-17 14:09:26 -07:00 коммит произвёл GitHub
Родитель 05ad38ca45
Коммит b2439a3c67
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 11 добавлений и 14 удалений

Просмотреть файл

@ -708,9 +708,6 @@ dotnet_diagnostic.CA1014.severity = none
# CA1824: Mark assemblies with NeutralResourcesLanguageAttribute
dotnet_diagnostic.CA1824.severity = none
# CA1820: Test for empty strings using string length
dotnet_diagnostic.CA1820.severity = suggestion
# CA1508: Avoid dead conditional code
dotnet_diagnostic.CA1508.severity = suggestion
@ -885,7 +882,7 @@ dotnet_diagnostic.IDE0016.severity = suggestion
# IDE0039: Use local function
dotnet_diagnostic.IDE0039.severity = suggestion
# IDE0220:
# IDE0220:
dotnet_diagnostic.IDE0220.severity = suggestion
# IDE0031: Null check can be simplified
@ -913,4 +910,4 @@ dotnet_diagnostic.CA1724.severity = suggestion
dotnet_diagnostic.SA1028.severity = suggestion
# IL3000: always returns an empty string for assemblies embedded in a single-file app.
dotnet_diagnostic.IL3000.severity = suggestion
dotnet_diagnostic.IL3000.severity = suggestion

Просмотреть файл

@ -211,7 +211,7 @@ namespace Microsoft.ComponentDetection.Detectors.Ruby
{
line = lines[0].TrimEnd();
lines.RemoveAt(0);
if (line.Trim().Equals(string.Empty))
if (string.IsNullOrEmpty(line.Trim()))
{
break;
}

Просмотреть файл

@ -35,7 +35,7 @@ namespace Microsoft.ComponentDetection.Detectors.Rust
version = versionMatch.Success ? versionMatch.Value : null;
source = sourceMatch.Success ? sourceMatch.Value : null;
if (source == string.Empty)
if (string.IsNullOrEmpty(source))
{
source = null;
}

Просмотреть файл

@ -23,7 +23,7 @@ namespace Microsoft.ComponentDetection.Detectors.Rust.SemVer
this.comparators = new List<Comparator> { };
spec = spec.Trim();
if (spec == string.Empty)
if (string.IsNullOrEmpty(spec))
{
spec = "*";
}
@ -78,16 +78,16 @@ namespace Microsoft.ComponentDetection.Detectors.Rust.SemVer
public bool IsSatisfied(SemVersion version)
{
var satisfied = this.comparators.All(c => c.IsSatisfied(version));
if (version.Prerelease != string.Empty)
if (!string.IsNullOrEmpty(version.Prerelease))
{
// If the version is a pre-release, then one of the
// comparators must have the same version and also include
// a pre-release tag.
return satisfied && this.comparators.Any(c =>
c.Version.Prerelease != string.Empty &&
c.Version.Major == version.Major &&
c.Version.Minor == version.Minor &&
c.Version.Patch == version.Patch);
!string.IsNullOrEmpty(c.Version.Prerelease) &&
c.Version.Major == version.Major &&
c.Version.Minor == version.Minor &&
c.Version.Patch == version.Patch);
}
else
{

Просмотреть файл

@ -47,7 +47,7 @@ namespace Microsoft.ComponentDetection.Detectors.Rust.SemVer
{
string[] xValues = { "X", "x", "*" };
if (input.Trim() == string.Empty)
if (string.IsNullOrEmpty(input.Trim()))
{
// Empty input means any version
return;