Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f320793

Browse files
authoredOct 24, 2024
Merge pull request #201 from apache/Feature/NetAnalyzers
Enable Microsoft.CodeAnalysis.NetAnalyzers
2 parents b008475 + 6356bfb commit f320793

File tree

185 files changed

+2663
-2773
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+2663
-2773
lines changed
 

‎src/Directory.Build.props

+10
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,25 @@
66
<LangVersion>latest</LangVersion>
77
<Nullable>Enable</Nullable>
88
<WarningsAsErrors>nullable</WarningsAsErrors>
9+
<AnalysisLevel>8</AnalysisLevel>
10+
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
11+
<RunAnalyzersDuringLiveAnalysis>true</RunAnalyzersDuringLiveAnalysis>
12+
<_SkipUpgradeNetAnalyzersNuGetWarning>true</_SkipUpgradeNetAnalyzersNuGetWarning>
13+
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
914
</PropertyGroup>
1015
<PropertyGroup Label="Package Versions">
1116
<SystemConfigurationConfigurationManagerPackageVersion>4.5.0</SystemConfigurationConfigurationManagerPackageVersion>
1217
<MicrosoftSourceLinkGitHubPackageVersion>8.0.0</MicrosoftSourceLinkGitHubPackageVersion>
18+
<!-- Analyzer packages -->
19+
<MicrosoftNetAnalyzersPackageVersion>8.0.0</MicrosoftNetAnalyzersPackageVersion>
1320
<!-- Test Packages -->
1421
<MicrosoftNetTestSdkPackageVersion>17.11.1</MicrosoftNetTestSdkPackageVersion>
1522
<NUnitAnalyzersPackageVersion>4.3.0</NUnitAnalyzersPackageVersion>
1623
<NUnitPackageVersion>4.2.2</NUnitPackageVersion>
1724
<NUnit3TestAdapterPackageVersion>4.6.0</NUnit3TestAdapterPackageVersion>
1825
<QuackersTestLoggerPackageVersion>1.0.25</QuackersTestLoggerPackageVersion>
1926
</PropertyGroup>
27+
<ItemGroup>
28+
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)\log4net.globalconfig" />
29+
</ItemGroup>
2030
</Project>

‎src/log4net.Tests/Appender/AdoNet/Log4NetCommand.cs

+6-21
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
namespace log4net.Tests.Appender.AdoNet;
2626

27-
public class Log4NetCommand : IDbCommand
27+
internal sealed class Log4NetCommand : IDbCommand
2828
{
2929
public Log4NetCommand()
3030
{
@@ -48,10 +48,7 @@ public int ExecuteNonQuery()
4848

4949
public int ExecuteNonQueryCount { get; private set; }
5050

51-
public IDbDataParameter CreateParameter()
52-
{
53-
return new Log4NetParameter();
54-
}
51+
public IDbDataParameter CreateParameter() => new Log4NetParameter();
5552

5653
#pragma warning disable CS8766 // Nullability of reference types in return type doesn't match implicitly implemented member (possibly because of nullability attributes).
5754
public string? CommandText { get; set; }
@@ -68,25 +65,13 @@ public void Prepare()
6865

6966
public static Log4NetCommand? MostRecentInstance { get; private set; }
7067

71-
public void Cancel()
72-
{
73-
throw new NotImplementedException();
74-
}
68+
public void Cancel() => throw new NotImplementedException();
7569

76-
public IDataReader ExecuteReader()
77-
{
78-
throw new NotImplementedException();
79-
}
70+
public IDataReader ExecuteReader() => throw new NotImplementedException();
8071

81-
public IDataReader ExecuteReader(CommandBehavior behavior)
82-
{
83-
throw new NotImplementedException();
84-
}
72+
public IDataReader ExecuteReader(CommandBehavior behavior) => throw new NotImplementedException();
8573

86-
public object ExecuteScalar()
87-
{
88-
throw new NotImplementedException();
89-
}
74+
public object ExecuteScalar() => throw new NotImplementedException();
9075

9176
public IDbConnection? Connection
9277
{

0 commit comments

Comments
 (0)
Please sign in to comment.