mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Add validation for DirtyField strings (#5713)
* Add ValidateMemberAttribute, analyzer and test
* Use attribute on DirtyFields methods
* Defer member lookup
* Additional test case
* Add support for collection types
* Poke tests
* Revert "Add support for collection types"
This reverts commit 2b8f5534bd.
* break, not continue
* Cheaper attribute check with AttributeHelper
* Clean up unused helper method
---------
Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
This commit is contained in:
15
Robust.Shared/Analyzers/ValidateMemberAttribute.cs
Normal file
15
Robust.Shared/Analyzers/ValidateMemberAttribute.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace Robust.Shared.Analyzers;
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that a string parameter matches the name
|
||||
/// of a member of the first type argument.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This just does a string comparison with the member name.
|
||||
/// An identically-named member on a different class will be
|
||||
/// considered valid.
|
||||
/// </remarks>
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public sealed class ValidateMemberAttribute : Attribute;
|
||||
Reference in New Issue
Block a user