Clean diagnostic rules

Move the following diagnostics into static readonly fields: GD0101, GD0102, GD0103, GD0104, GD0105, GD0106, GD0107, GD0201, GD0202, GD0203, GD0301, GD0302, GD0303, GD0401, GD0402.

To be more consistent, the titles for the following diagnostics were modified: GD0101, GD0105, GD0106, GD0302, GD0303, GD0401, GD0402. A subsequent update of the documentation repo is needed.

Tests for the following diagnostics were created: GD0201, GD0202, GD0203.
This commit is contained in:
Paul Joannon 2024-02-17 21:12:06 +01:00
parent 9ae8a0e9cd
commit 5981886fb7
No known key found for this signature in database
GPG key ID: C12F69B0AD0390DD
11 changed files with 267 additions and 430 deletions

View file

@ -4,4 +4,15 @@ public partial class EventSignals : GodotObject
{
[Signal]
public delegate void MySignalEventHandler(string str, int num);
private struct MyStruct { }
[Signal]
private delegate void {|GD0201:MyInvalidSignal|}();
[Signal]
private delegate void MyInvalidParameterTypeSignalEventHandler(MyStruct {|GD0202:myStruct|});
[Signal]
private delegate MyStruct {|GD0203:MyInvalidReturnTypeSignalEventHandler|}();
}

View file

@ -15,8 +15,8 @@ public partial class CustomGlobalClass2 : Node
}
// This raises a GD0401 diagnostic error: global classes must inherit from GodotObject
{|GD0401:[GlobalClass]
public partial class CustomGlobalClass3
[GlobalClass]
public partial class {|GD0401:CustomGlobalClass3|}
{
}|}
}

View file

@ -8,8 +8,8 @@ public partial class CustomGlobalClass : GodotObject
}
// This raises a GD0402 diagnostic error: global classes can't have any generic type parameter
{|GD0402:[GlobalClass]
public partial class CustomGlobalClass<T> : GodotObject
[GlobalClass]
public partial class {|GD0402:CustomGlobalClass|}<T> : GodotObject
{
}|}
}