Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Dapr.Workflow.Analyzers/AnalyzerReleases.Unshipped.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
; Unshipped analyzer release
; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md

### New Rules

Rule ID | Category | Severity | Notes
--------|----------|----------|--------------------
DAPR1303 | Usage | Warning | The provided input type does not match the target workflow or activity input type
DAPR1304 | Usage | Warning | The requested output type does not match the target workflow or activity output type
27 changes: 27 additions & 0 deletions src/Dapr.Workflow.Analyzers/CompilationExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Microsoft.CodeAnalysis;

namespace Dapr.Workflow.Analyzers;

internal static class CompilationExtensions
{
private const string DaprWorkflowClientMetadataName = "Dapr.Workflow.DaprWorkflowClient";
private const string IDaprWorkflowClientMetadataName = "Dapr.Workflow.IDaprWorkflowClient";
private const string WorkflowContextMetadataName = "Dapr.Workflow.WorkflowContext";
private const string WorkflowBaseMetadataName = "Dapr.Workflow.Workflow`2";
private const string WorkflowActivityBaseMetadataName = "Dapr.Workflow.WorkflowActivity`2";

internal static INamedTypeSymbol? GetDaprWorkflowClientType(this Compilation compilation) =>
compilation.GetTypeByMetadataName(DaprWorkflowClientMetadataName);

internal static INamedTypeSymbol? GetIDaprWorkflowClientType(this Compilation compilation) =>
compilation.GetTypeByMetadataName(IDaprWorkflowClientMetadataName);

internal static INamedTypeSymbol? GetWorkflowContextType(this Compilation compilation) =>
compilation.GetTypeByMetadataName(WorkflowContextMetadataName);

internal static INamedTypeSymbol? GetWorkflowBaseType(this Compilation compilation) =>
compilation.GetTypeByMetadataName(WorkflowBaseMetadataName);

internal static INamedTypeSymbol? GetWorkflowActivityBaseType(this Compilation compilation) =>
compilation.GetTypeByMetadataName(WorkflowActivityBaseMetadataName);
}
36 changes: 36 additions & 0 deletions src/Dapr.Workflow.Analyzers/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion src/Dapr.Workflow.Analyzers/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,16 @@
<data name="DAPR1302MessageFormat" xml:space="preserve">
<value>The workflow activity type '{0}' is not registered with the dependency injection provider</value>
</data>
</root>
<data name="DAPR1303Title" xml:space="preserve">
<value>The provided input type does not match the target workflow or activity input type</value>
</data>
<data name="DAPR1303MessageFormat" xml:space="preserve">
<value>The provided input type '{0}' does not match the expected input type '{1}' for {2} '{3}'</value>
</data>
<data name="DAPR1304Title" xml:space="preserve">
<value>The requested output type does not match the target workflow or activity output type</value>
</data>
<data name="DAPR1304MessageFormat" xml:space="preserve">
<value>The requested output type '{0}' does not match the declared output type '{1}' for {2} '{3}'</value>
</data>
</root>
Loading
Loading