mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
* Add analyzers to detect some prototype misuse Detects people marking prototype as NetSerializable. Detects people creating new prototype instances themselves. * Update Robust.Analyzers/PrototypeNetSerializableAnalyzer.cs Co-authored-by: Tayrtahn <tayrtahn@gmail.com> --------- Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
18 lines
598 B
C#
18 lines
598 B
C#
using Microsoft.CodeAnalysis;
|
|
using Microsoft.CodeAnalysis.CSharp;
|
|
using Microsoft.CodeAnalysis.CSharp.Testing;
|
|
using Microsoft.CodeAnalysis.Diagnostics;
|
|
using Microsoft.CodeAnalysis.Testing;
|
|
|
|
namespace Robust.Analyzers.Tests;
|
|
|
|
public sealed class RTAnalyzerTest<TAnalyzer> : CSharpAnalyzerTest<TAnalyzer, DefaultVerifier>
|
|
where TAnalyzer : DiagnosticAnalyzer, new()
|
|
{
|
|
protected override ParseOptions CreateParseOptions()
|
|
{
|
|
var baseOptions = (CSharpParseOptions) base.CreateParseOptions();
|
|
return baseOptions.WithPreprocessorSymbols("ROBUST_ANALYZERS_TEST");
|
|
}
|
|
}
|