-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc760bc
commit cda2001
Showing
6 changed files
with
49 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace Akka.Analyzers; | ||
|
||
public static class RuleDescriptors | ||
{ | ||
private static DiagnosticDescriptor Rule( | ||
string id, | ||
string title, | ||
AnalysisCategory category, | ||
DiagnosticSeverity defaultSeverity, | ||
string messageFormat) | ||
{ | ||
// TODO: need real help links for each rule code | ||
var helpLink = $"https://getakka.net/"; | ||
|
||
return new DiagnosticDescriptor(id, title, messageFormat, category.ToString(), defaultSeverity, | ||
isEnabledByDefault: true, helpLinkUri: helpLink); | ||
} | ||
|
||
public static DiagnosticDescriptor Ak1000DoNotNewActors { get; } = Rule("Akka1000", | ||
"Do not use `new` to create actors", AnalysisCategory.ActorDesign, DiagnosticSeverity.Error, | ||
"Actors must be instantiated using `ActorOf` or `ActorOfAsTestActorRef` via a `Props` class."); | ||
|
||
public static DiagnosticDescriptor Ak1001CloseOverSenderUsingPipeTo { get; } = Rule("Akka1002", | ||
"Should always close over `Sender` when using `PipeTo`", AnalysisCategory.ActorDesign, DiagnosticSeverity.Error, | ||
"When using `PipeTo`, you must always close over `Sender` to ensure that the actor's `Sender` property " + | ||
"is captured at the time you're scheduling the `PipeTo`, as this value may change asynchronously."); | ||
} |