-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix S1104 FP: Do not report in Unity serializable classes
- Loading branch information
1 parent
a94a3ae
commit 0825155
Showing
3 changed files
with
32 additions
and
1 deletion.
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
18 changes: 18 additions & 0 deletions
18
...zers/tests/SonarAnalyzer.Test/TestCases/FieldsShouldBeEncapsulatedInProperties.Unity3D.cs
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,18 @@ | ||
// https://github.com/SonarSource/sonar-dotnet/issues/7522 | ||
public class UnityMonoBehaviour : UnityEngine.MonoBehaviour | ||
{ | ||
public int Field1; // Compliant | ||
} | ||
|
||
public class UnityScriptableObject : UnityEngine.ScriptableObject | ||
{ | ||
public int Field1; // Compliant | ||
} | ||
|
||
// Unity3D does not seem to be available as a nuget package and we cannot use the original classes | ||
// Cannot run this test case in Concurrent mode because of the Concurrent namespace | ||
namespace UnityEngine | ||
{ | ||
public class MonoBehaviour { } | ||
public class ScriptableObject { } | ||
} |