Skip to content

Commit 1842963

Browse files
committed
Removed legacy suppressions from Microsoft Code Contracts
Microsoft Code Contract's static code analysis was prone to a number of false positives, which necessitated a few `[SuppressMessage()]` attributes to be sprinkled in the code. Since we no longer use Microsoft Code Contracts—and, in fact, the static code analysis isn't even supported with .NET Standard!—we're removing these suppressions.
1 parent 8caa148 commit 1842963

3 files changed

Lines changed: 0 additions & 15 deletions

File tree

OnTopic.Data.Caching/CachedTopicRepository.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,6 @@ public override int Save(Topic topic, bool isRecursive = false, bool isDraft = f
142142
| METHOD: MOVE
143143
\-------------------------------------------------------------------------------------------------------------------------*/
144144
/// <inheritdoc />
145-
[System.Diagnostics.CodeAnalysis.SuppressMessage(
146-
"Microsoft.Contracts",
147-
"TestAlwaysEvaluatingToAConstant",
148-
Justification = "Sibling may be null from overloaded caller."
149-
)]
150145
public override void Move(Topic topic, Topic target, Topic? sibling) => _dataProvider.Move(topic, target, sibling);
151146

152147
/*==========================================================================================================================

OnTopic.Data.Sql/SqlTopicRepository.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,6 @@ void recurse() {
517517
| METHOD: MOVE
518518
\-------------------------------------------------------------------------------------------------------------------------*/
519519
/// <inheritdoc />
520-
[System.Diagnostics.CodeAnalysis.SuppressMessage(
521-
"Microsoft.Contracts",
522-
"TestAlwaysEvaluatingToAConstant",
523-
Justification = "Sibling may be null from overloaded caller."
524-
)]
525520
public override void Move(Topic topic, Topic target, Topic? sibling) {
526521

527522
/*------------------------------------------------------------------------------------------------------------------------

OnTopic.TestDoubles/StubTopicRepository.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@ public override int Save(Topic topic, bool isRecursive = false, bool isDraft = f
139139
| METHOD: MOVE
140140
\-------------------------------------------------------------------------------------------------------------------------*/
141141
/// <inheritdoc />
142-
[System.Diagnostics.CodeAnalysis.SuppressMessage(
143-
"Microsoft.Contracts",
144-
"TestAlwaysEvaluatingToAConstant",
145-
Justification = "Sibling may be null from overloaded caller."
146-
)]
147142
public override void Move(Topic topic, Topic target, Topic? sibling) {
148143

149144
/*------------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)