diff --git a/.editorconfig b/.editorconfig
index 7202291eb6..4761a0d5ba 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -169,6 +169,21 @@ dotnet_diagnostic.CA1303.severity = none
dotnet_diagnostic.IDE0073.severity = warning
file_header_template = Copyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the MIT License.
+# IDE0005: Remove unnecessary usings
+dotnet_diagnostic.IDE0005.severity = warning
+
+# IDE0055: All formatting rules
+dotnet_diagnostic.IDE0055.severity = warning
+
+# CA1845: Use span-based 'string.Concat'
+dotnet_diagnostic.CA1845.severity = warning
+
+# CA1846: Prefer AsSpan over Substring
+dotnet_diagnostic.CA1846.severity = warning
+
+[{GlobalSuppressions.cs,TrimmingAttributes.cs}]
+dotnet_diagnostic.IDE0073.severity = none
+
# C++ Files
[*.{cpp,h,in}]
curly_bracket_next_line = true
diff --git a/benchmark/Microsoft.IdentityModel.Benchmarks/AsymmetricAdapterSignatures.cs b/benchmark/Microsoft.IdentityModel.Benchmarks/AsymmetricAdapterSignatures.cs
index d9c3886a03..77cabdedfe 100644
--- a/benchmark/Microsoft.IdentityModel.Benchmarks/AsymmetricAdapterSignatures.cs
+++ b/benchmark/Microsoft.IdentityModel.Benchmarks/AsymmetricAdapterSignatures.cs
@@ -24,7 +24,7 @@ public class AsymmetricAdapterSignatures
[GlobalSetup]
public void Setup()
{
- SecurityTokenDescriptor securityTokenDescriptor = new ()
+ SecurityTokenDescriptor securityTokenDescriptor = new()
{
SigningCredentials = BenchmarkUtils.SigningCredentialsRsaSha256,
Claims = BenchmarkUtils.Claims,
@@ -32,12 +32,12 @@ public void Setup()
};
_bytesToSign = Encoding.UTF8.GetBytes((new JsonWebTokenHandler()).CreateToken(securityTokenDescriptor));
- _rsaAsymmetricAdapter = new AsymmetricAdapter(
- BenchmarkUtils.SigningCredentialsRsaSha256.Key,
- SecurityAlgorithms.RsaSha256,
- SHA256.Create(),
- SupportedAlgorithms.GetHashAlgorithmName(SecurityAlgorithms.RsaSha256),
- true );
+ _rsaAsymmetricAdapter = new AsymmetricAdapter(
+ BenchmarkUtils.SigningCredentialsRsaSha256.Key,
+ SecurityAlgorithms.RsaSha256,
+ SHA256.Create(),
+ SupportedAlgorithms.GetHashAlgorithmName(SecurityAlgorithms.RsaSha256),
+ true);
_signatureBuffer = new byte[256];
}
diff --git a/benchmark/Microsoft.IdentityModel.Benchmarks/BenchmarkConfig.cs b/benchmark/Microsoft.IdentityModel.Benchmarks/BenchmarkConfig.cs
index 8e70089ee2..628d6c1225 100644
--- a/benchmark/Microsoft.IdentityModel.Benchmarks/BenchmarkConfig.cs
+++ b/benchmark/Microsoft.IdentityModel.Benchmarks/BenchmarkConfig.cs
@@ -23,7 +23,7 @@ public BenchmarkConfig()
.WithOrderer(new DefaultOrderer(SummaryOrderPolicy.Method))
.HideColumns(Column.WarmupCount, Column.Type, Column.Job)
.AddDiagnoser(MemoryDiagnoser.Default); // https://benchmarkdotnet.org/articles/configs/diagnosers.html
- //.AddDiagnoser(new EtwProfiler()) // Uncomment to generate traces / flame graphs. Doc: https://adamsitnik.com/ETW-Profiler/
+ //.AddDiagnoser(new EtwProfiler()) // Uncomment to generate traces / flame graphs. Doc: https://adamsitnik.com/ETW-Profiler/
}
}
}
diff --git a/build/common.props b/build/common.props
index e03f9d5077..8d402d23a1 100644
--- a/build/common.props
+++ b/build/common.props
@@ -28,6 +28,7 @@
$(SrcStandardTargets)
$(NetStandardVersion)
12
+ true
diff --git a/build/commonTest.props b/build/commonTest.props
index ff56d0f461..914262d600 100644
--- a/build/commonTest.props
+++ b/build/commonTest.props
@@ -18,6 +18,7 @@
$(DotNetCoreAppRuntimeVersion)
false
12
+ true
@@ -27,6 +28,7 @@
$(NoWarn);SYSLIB0050
$(NoWarn);SYSLIB0051
+ $(NoWarn);CS1591
diff --git a/src/Microsoft.IdentityModel.JsonWebTokens/Json/JsonClaimSet.cs b/src/Microsoft.IdentityModel.JsonWebTokens/Json/JsonClaimSet.cs
index 892b8a68fc..7bcfb4d4ce 100644
--- a/src/Microsoft.IdentityModel.JsonWebTokens/Json/JsonClaimSet.cs
+++ b/src/Microsoft.IdentityModel.JsonWebTokens/Json/JsonClaimSet.cs
@@ -74,7 +74,7 @@ internal static void CreateClaimFromObject(List claims, string claimType,
else if (value is double d)
claims.Add(new Claim(claimType, d.ToString(CultureInfo.InvariantCulture), ClaimValueTypes.Double, issuer, issuer));
else if (value is DateTime dt)
- claims.Add(new Claim(claimType, dt.ToString("o",CultureInfo.InvariantCulture), ClaimValueTypes.DateTime, issuer, issuer));
+ claims.Add(new Claim(claimType, dt.ToString("o", CultureInfo.InvariantCulture), ClaimValueTypes.DateTime, issuer, issuer));
else if (value is float f)
claims.Add(new Claim(claimType, f.ToString(CultureInfo.InvariantCulture), ClaimValueTypes.Double, issuer, issuer));
else if (value is decimal m)
@@ -320,7 +320,7 @@ internal T GetValue(string key, bool throwEx, out bool found)
else if (typeof(T) == typeof(Collection