Skip to content

Commit

Permalink
NET-830 Align SonarAnalyzer.Core.Analyzers directory and namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-mikula-sonarsource authored and sonartech committed Dec 7, 2024
1 parent af27e6b commit ea9291b
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
<Using Include="Microsoft.CodeAnalysis.CSharp.Extensions" />
<Using Include="Microsoft.CodeAnalysis.Diagnostics" />
<Using Include="SonarAnalyzer.AnalysisContext" />
<Using Include="SonarAnalyzer.Analyzers" />
<Using Include="SonarAnalyzer.Common" />
<Using Include="SonarAnalyzer.Core.Analyzers" />
<Using Include="SonarAnalyzer.Core.Extensions" />
<Using Include="SonarAnalyzer.Core.Facade" />
<Using Include="SonarAnalyzer.Core.Semantics" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/

using SonarAnalyzer.Analyzers;
using SonarAnalyzer.Core.Analyzers;

namespace SonarAnalyzer.CSharp.Styling.Common;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/

using SonarAnalyzer.Analyzers;
using SonarAnalyzer.Core.Analyzers;

namespace SonarAnalyzer.CSharp.Styling.Common;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
<Using Include="Microsoft.CodeAnalysis.CSharp.Extensions" />
<Using Include="Microsoft.CodeAnalysis.Diagnostics" />
<Using Include="SonarAnalyzer.AnalysisContext" />
<Using Include="SonarAnalyzer.Analyzers" />
<Using Include="SonarAnalyzer.CFG.Extensions" />
<Using Include="SonarAnalyzer.Common" />
<Using Include="SonarAnalyzer.Core.Analyzers" />
<Using Include="SonarAnalyzer.Core.Extensions" />
<Using Include="SonarAnalyzer.Core.Facade" />
<Using Include="SonarAnalyzer.Core.Semantics" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/

namespace SonarAnalyzer.Analyzers;
namespace SonarAnalyzer.Core.Analyzers;

public static class DiagnosticDescriptorFactory
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/

namespace SonarAnalyzer.Analyzers;
namespace SonarAnalyzer.Core.Analyzers;

public abstract class HotspotDiagnosticAnalyzer : SonarDiagnosticAnalyzer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/

namespace SonarAnalyzer.Analyzers;
namespace SonarAnalyzer.Core.Analyzers;

public abstract class ParametrizedDiagnosticAnalyzer : SonarDiagnosticAnalyzer
{
Expand Down
2 changes: 1 addition & 1 deletion analyzers/src/SonarAnalyzer.Core/Analyzers/SonarCodeFix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

using Microsoft.CodeAnalysis.CodeFixes;

namespace SonarAnalyzer.Analyzers;
namespace SonarAnalyzer.Core.Analyzers;

public abstract class SonarCodeFix : CodeFixProvider
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

using RoslynAnalysisContext = Microsoft.CodeAnalysis.Diagnostics.AnalysisContext;

namespace SonarAnalyzer.Analyzers;
namespace SonarAnalyzer.Core.Analyzers;

public abstract class SonarDiagnosticAnalyzer : DiagnosticAnalyzer
{
Expand Down Expand Up @@ -49,8 +49,9 @@ public abstract class SonarDiagnosticAnalyzer<TSyntaxKind> : SonarDiagnosticAnal
{
protected abstract string MessageFormat { get; }
protected abstract ILanguageFacade<TSyntaxKind> Language { get; }
protected DiagnosticDescriptor Rule { get; }

public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);
protected DiagnosticDescriptor Rule { get; }

protected SonarDiagnosticAnalyzer(string diagnosticId) =>
Rule = Language.CreateDescriptor(diagnosticId, MessageFormat);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@

using SonarAnalyzer.Core.Trackers;

namespace SonarAnalyzer.Analyzers;
namespace SonarAnalyzer.Core.Analyzers;

public abstract class TrackerHotspotDiagnosticAnalyzer<TSyntaxKind> : HotspotDiagnosticAnalyzer where TSyntaxKind : struct
{
protected abstract ILanguageFacade<TSyntaxKind> Language { get; }
protected abstract void Initialize(TrackerInput input);

protected DiagnosticDescriptor Rule { get; }

public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);
protected DiagnosticDescriptor Rule { get; }

protected TrackerHotspotDiagnosticAnalyzer(IAnalyzerConfiguration configuration, string diagnosticId, string messageFormat) : base(configuration) =>
Rule = Language.CreateDescriptor(diagnosticId, messageFormat);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/

using static SonarAnalyzer.Analyzers.DiagnosticDescriptorFactory;
using static SonarAnalyzer.Core.Analyzers.DiagnosticDescriptorFactory;

namespace SonarAnalyzer.AnalysisContext;

Expand Down
2 changes: 1 addition & 1 deletion analyzers/src/SonarAnalyzer.Core/SonarAnalyzer.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<Using Include="Microsoft.CodeAnalysis" />
<Using Include="Microsoft.CodeAnalysis.Diagnostics" />
<Using Include="SonarAnalyzer.AnalysisContext" />
<Using Include="SonarAnalyzer.Analyzers" />
<Using Include="SonarAnalyzer.Common" />
<Using Include="SonarAnalyzer.Core.Analyzers" />
<Using Include="SonarAnalyzer.Core.Extensions" />
<Using Include="SonarAnalyzer.Core.Facade" />
<Using Include="SonarAnalyzer.Core.Semantics" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<Using Include="Microsoft.CodeAnalysis.VisualBasic.Syntax" />
<Using Include="Microsoft.CodeAnalysis.VisualBasic.Extensions" />
<Using Include="SonarAnalyzer.AnalysisContext" />
<Using Include="SonarAnalyzer.Analyzers" />
<Using Include="SonarAnalyzer.Common" />
<Using Include="SonarAnalyzer.Core.Analyzers" />
<Using Include="SonarAnalyzer.Core.Extensions" />
<Using Include="SonarAnalyzer.Core.Facade" />
<Using Include="SonarAnalyzer.Core.Semantics" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<Using Include="Microsoft.CodeAnalysis.VisualBasic.Syntax" />
<Using Include="Microsoft.CodeAnalysis.VisualBasic.Extensions" />
<Using Include="SonarAnalyzer.AnalysisContext" />
<Using Include="SonarAnalyzer.Analyzers" />
<Using Include="SonarAnalyzer.Common" />
<Using Include="SonarAnalyzer.Core.Analyzers" />
<Using Include="SonarAnalyzer.Core.Extensions" />
<Using Include="SonarAnalyzer.Core.Facade" />
<Using Include="SonarAnalyzer.Core.Semantics" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

using SonarAnalyzer.AnalysisContext;
using SonarAnalyzer.Analyzers;
using SonarAnalyzer.Core.Analyzers;

namespace SonarAnalyzer.CSharp.Core.Test.Syntax.Extensions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<Using Include="Microsoft.CodeAnalysis.Diagnostics" />
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
<Using Include="NSubstitute" />
<Using Include="SonarAnalyzer.Analyzers" />
<Using Include="SonarAnalyzer.Common" />
<Using Include="SonarAnalyzer.Core.Analyzers" />
<Using Include="SonarAnalyzer.Core.Extensions" />
<Using Include="SonarAnalyzer.Core.Semantics" />
<Using Include="SonarAnalyzer.TestFramework.Analyzers" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<Using Include="Microsoft.CodeAnalysis" />
<Using Include="Microsoft.CodeAnalysis.Diagnostics" />
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
<Using Include="SonarAnalyzer.Analyzers" />
<Using Include="SonarAnalyzer.Common" />
<Using Include="SonarAnalyzer.Core.Analyzers" />
<Using Include="SonarAnalyzer.Core.Extensions" />
<Using Include="SonarAnalyzer.Core.Semantics" />
<Using Include="SonarAnalyzer.Helpers" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
<Using Include="Microsoft.CodeAnalysis" />
<Using Include="Microsoft.CodeAnalysis.Diagnostics" />
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
<Using Include="SonarAnalyzer.Analyzers" />
<Using Include="SonarAnalyzer.Common" />
<Using Include="SonarAnalyzer.Core.Analyzers" />
<Using Include="SonarAnalyzer.Core.Extensions" />
<Using Include="SonarAnalyzer.Core.Semantics" />
<Using Include="SonarAnalyzer.Helpers" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CSharp;
using SonarAnalyzer.AnalysisContext;
using SonarAnalyzer.Analyzers;
using SonarAnalyzer.Core.Analyzers;
using SonarAnalyzer.TestFramework.Verification;

namespace SonarAnalyzer.Test.TestFramework.Tests.Verification;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<Using Include="Microsoft.CodeAnalysis" />
<Using Include="Microsoft.CodeAnalysis.Diagnostics" />
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
<Using Include="SonarAnalyzer.Analyzers" />
<Using Include="SonarAnalyzer.Common" />
<Using Include="SonarAnalyzer.Core.Analyzers" />
<Using Include="SonarAnalyzer.Core.Extensions" />
<Using Include="SonarAnalyzer.Helpers" />
<Using Include="SonarAnalyzer.TestFramework.Common" />
Expand Down

0 comments on commit ea9291b

Please sign in to comment.