Skip to content

Commit 00e72cb

Browse files
committed
Fix warnings.
1 parent 0b75ef0 commit 00e72cb

29 files changed

Lines changed: 213 additions & 214 deletions

File tree

PropertyChangedAnalyzers.Test/INPC002MutablePublicPropertyShouldNotify/CodeFix.AutoProperty.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName
6262
}
6363
}
6464
}";
65-
var expectedDiagnostic = ExpectedDiagnostic.WithMessage("Property 'P' should notify when value changes.");
65+
var expectedDiagnostic = ExpectedDiagnostic.WithMessage("Property 'P' should notify when value changes");
6666
RoslynAssert.CodeFix(Analyzer, Fix, expectedDiagnostic, before, after, fixTitle: "Notify when value changes.");
6767
}
6868

PropertyChangedAnalyzers.Test/INPC010GetAndSetSame/Diagnostics.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName
5050
}
5151
}";
5252

53-
RoslynAssert.Diagnostics(Analyzer, ExpectedDiagnostic.WithMessage("The property gets and sets a different backing member."), code);
53+
RoslynAssert.Diagnostics(Analyzer, ExpectedDiagnostic.WithMessage("The property gets and sets a different backing member"), code);
5454
}
5555

5656
[Test]
@@ -122,7 +122,7 @@ public int ↓P
122122
}
123123
}";
124124

125-
RoslynAssert.Diagnostics(Analyzer, ExpectedDiagnostic.WithMessage("The property gets and sets a different backing member."), code);
125+
RoslynAssert.Diagnostics(Analyzer, ExpectedDiagnostic.WithMessage("The property gets and sets a different backing member"), code);
126126
}
127127

128128
[Test]

PropertyChangedAnalyzers.Test/INPC022EqualToBackingField/CodeFix.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName
106106
}
107107
}
108108
}";
109-
RoslynAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic.WithMessage("Comparison should be with backing field."), before, after, fixTitle: "Use: this.p");
109+
RoslynAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic.WithMessage("Comparison should be with backing field"), before, after, fixTitle: "Use: this.p");
110110
}
111111

112112
[TestCaseSource(nameof(TestCases))]

PropertyChangedAnalyzers.sln

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.29209.62
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31912.275
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".sln", ".sln", "{A1A96555-15B1-4A0C-ADC1-059CEAA3F788}"
77
ProjectSection(SolutionItems) = preProject
@@ -40,7 +40,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{BAD2A4EE-6
4040
documentation\INPC023.md = documentation\INPC023.md
4141
documentation\INPC024.md = documentation\INPC024.md
4242
README.md = README.md
43-
.paket\Readme.paket.md = .paket\Readme.paket.md
4443
RELEASE_NOTES.md = RELEASE_NOTES.md
4544
EndProjectSection
4645
EndProject

PropertyChangedAnalyzers/Descriptors.cs

Lines changed: 69 additions & 69 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,31 @@ Roslyn analyzers for `INotifyPropertyChanged`.
1515

1616
| Id | Title
1717
| :-- | :--
18-
| [INPC001](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC001.md)| The class has mutable properties and should implement INotifyPropertyChanged.
19-
| [INPC002](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC002.md)| Mutable public property should notify.
20-
| [INPC003](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC003.md)| Notify when property changes.
18+
| [INPC001](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC001.md)| The class has mutable properties and should implement INotifyPropertyChanged
19+
| [INPC002](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC002.md)| Mutable public property should notify
20+
| [INPC003](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC003.md)| Notify when property changes
2121
| [INPC004](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC004.md)| Use [CallerMemberName]
22-
| [INPC005](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC005.md)| Check if value is different before notifying.
23-
| [INPC006_a](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC006_a.md)| Check if value is different using ReferenceEquals before notifying.
24-
| [INPC006_b](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC006_b.md)| Check if value is different using object.Equals before notifying.
25-
| [INPC007](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC007.md)| The class has PropertyChangedEvent but no invoker.
22+
| [INPC005](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC005.md)| Check if value is different before notifying
23+
| [INPC006_a](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC006_a.md)| Check if value is different using ReferenceEquals before notifying
24+
| [INPC006_b](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC006_b.md)| Check if value is different using object.Equals before notifying
25+
| [INPC007](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC007.md)| The class has PropertyChangedEvent but no invoker
2626
| [INPC008](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC008.md)| Struct must not implement INotifyPropertyChanged
27-
| [INPC009](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC009.md)| Don't raise PropertyChanged for missing property.
28-
| [INPC010](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC010.md)| The property gets and sets a different backing member.
29-
| [INPC011](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC011.md)| Don't shadow PropertyChanged event.
30-
| [INPC012](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC012.md)| Don't use expression for raising PropertyChanged.
31-
| [INPC013](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC013.md)| Use nameof.
32-
| [INPC014](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC014.md)| Prefer setting backing field in constructor.
33-
| [INPC015](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC015.md)| Property is recursive.
34-
| [INPC016](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC016.md)| Notify after update.
35-
| [INPC017](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC017.md)| Backing field name must match.
36-
| [INPC018](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC018.md)| PropertyChanged invoker should be protected when the class is not sealed.
37-
| [INPC019](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC019.md)| Getter should return backing field.
38-
| [INPC020](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC020.md)| Prefer expression body accessor.
39-
| [INPC021](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC021.md)| Setter should set backing field.
40-
| [INPC022](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC022.md)| Comparison should be with backing field.
41-
| [INPC023](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC023.md)| Don't use instance equals in setter.
42-
| [INPC024](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC024.md)| ReferenceEquals is always false for value types.
27+
| [INPC009](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC009.md)| Don't raise PropertyChanged for missing property
28+
| [INPC010](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC010.md)| The property gets and sets a different backing member
29+
| [INPC011](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC011.md)| Don't shadow PropertyChanged event
30+
| [INPC012](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC012.md)| Don't use expression for raising PropertyChanged
31+
| [INPC013](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC013.md)| Use nameof
32+
| [INPC014](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC014.md)| Prefer setting backing field in constructor
33+
| [INPC015](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC015.md)| Property is recursive
34+
| [INPC016](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC016.md)| Notify after update
35+
| [INPC017](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC017.md)| Backing field name must match
36+
| [INPC018](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC018.md)| PropertyChanged invoker should be protected when the class is not sealed
37+
| [INPC019](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC019.md)| Getter should return backing field
38+
| [INPC020](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC020.md)| Prefer expression body accessor
39+
| [INPC021](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC021.md)| Setter should set backing field
40+
| [INPC022](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC022.md)| Comparison should be with backing field
41+
| [INPC023](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC023.md)| Don't use instance equals in setter
42+
| [INPC024](https://github.com/DotNetAnalyzers/PropertyChangedAnalyzers/tree/master/documentation/INPC024.md)| ReferenceEquals is always false for value types
4343

4444
## Using PropertyChangedAnalyzers
4545

documentation/INPC001.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# INPC001
2-
## The class has mutable properties and should implement INotifyPropertyChanged.
2+
## The class has mutable properties and should implement INotifyPropertyChanged
33

44
| Topic | Value
55
| :-- | :--
@@ -33,21 +33,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros
3333

3434
### Via #pragma directive.
3535
```C#
36-
#pragma warning disable INPC001 // The class has mutable properties and should implement INotifyPropertyChanged.
36+
#pragma warning disable INPC001 // The class has mutable properties and should implement INotifyPropertyChanged
3737
Code violating the rule here
38-
#pragma warning restore INPC001 // The class has mutable properties and should implement INotifyPropertyChanged.
38+
#pragma warning restore INPC001 // The class has mutable properties and should implement INotifyPropertyChanged
3939
```
4040

4141
Or put this at the top of the file to disable all instances.
4242
```C#
43-
#pragma warning disable INPC001 // The class has mutable properties and should implement INotifyPropertyChanged.
43+
#pragma warning disable INPC001 // The class has mutable properties and should implement INotifyPropertyChanged
4444
```
4545

4646
### Via attribute `[SuppressMessage]`.
4747

4848
```C#
4949
[System.Diagnostics.CodeAnalysis.SuppressMessage("PropertyChangedAnalyzers.PropertyChanged",
50-
"INPC001:The class has mutable properties and should implement INotifyPropertyChanged.",
50+
"INPC001:The class has mutable properties and should implement INotifyPropertyChanged",
5151
Justification = "Reason...")]
5252
```
5353
<!-- end generated config severity -->

documentation/INPC002.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# INPC002
2-
## Mutable public property should notify.
2+
## Mutable public property should notify
33

44
| Topic | Value
55
| :-- | :--
@@ -107,21 +107,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros
107107

108108
### Via #pragma directive.
109109
```C#
110-
#pragma warning disable INPC002 // Mutable public property should notify.
110+
#pragma warning disable INPC002 // Mutable public property should notify
111111
Code violating the rule here
112-
#pragma warning restore INPC002 // Mutable public property should notify.
112+
#pragma warning restore INPC002 // Mutable public property should notify
113113
```
114114

115115
Or put this at the top of the file to disable all instances.
116116
```C#
117-
#pragma warning disable INPC002 // Mutable public property should notify.
117+
#pragma warning disable INPC002 // Mutable public property should notify
118118
```
119119

120120
### Via attribute `[SuppressMessage]`.
121121

122122
```C#
123123
[System.Diagnostics.CodeAnalysis.SuppressMessage("PropertyChangedAnalyzers.PropertyChanged",
124-
"INPC002:Mutable public property should notify.",
124+
"INPC002:Mutable public property should notify",
125125
Justification = "Reason...")]
126126
```
127127
<!-- end generated config severity -->

documentation/INPC003.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# INPC003
2-
## Notify when property changes.
2+
## Notify when property changes
33

44
| Topic | Value
55
| :-- | :--
@@ -148,21 +148,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros
148148

149149
### Via #pragma directive.
150150
```C#
151-
#pragma warning disable INPC003 // Notify when property changes.
151+
#pragma warning disable INPC003 // Notify when property changes
152152
Code violating the rule here
153-
#pragma warning restore INPC003 // Notify when property changes.
153+
#pragma warning restore INPC003 // Notify when property changes
154154
```
155155

156156
Or put this at the top of the file to disable all instances.
157157
```C#
158-
#pragma warning disable INPC003 // Notify when property changes.
158+
#pragma warning disable INPC003 // Notify when property changes
159159
```
160160

161161
### Via attribute `[SuppressMessage]`.
162162

163163
```C#
164164
[System.Diagnostics.CodeAnalysis.SuppressMessage("PropertyChangedAnalyzers.PropertyChanged",
165-
"INPC003:Notify when property changes.",
165+
"INPC003:Notify when property changes",
166166
Justification = "Reason...")]
167167
```
168168
<!-- end generated config severity -->

documentation/INPC005.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# INPC005
2-
## Check if value is different before notifying.
2+
## Check if value is different before notifying
33

44
| Topic | Value
55
| :-- | :--
@@ -30,21 +30,21 @@ Configure the severity per project, for more info see [MSDN](https://msdn.micros
3030

3131
### Via #pragma directive.
3232
```C#
33-
#pragma warning disable INPC005 // Check if value is different before notifying.
33+
#pragma warning disable INPC005 // Check if value is different before notifying
3434
Code violating the rule here
35-
#pragma warning restore INPC005 // Check if value is different before notifying.
35+
#pragma warning restore INPC005 // Check if value is different before notifying
3636
```
3737

3838
Or put this at the top of the file to disable all instances.
3939
```C#
40-
#pragma warning disable INPC005 // Check if value is different before notifying.
40+
#pragma warning disable INPC005 // Check if value is different before notifying
4141
```
4242

4343
### Via attribute `[SuppressMessage]`.
4444

4545
```C#
4646
[System.Diagnostics.CodeAnalysis.SuppressMessage("PropertyChangedAnalyzers.PropertyChanged",
47-
"INPC005:Check if value is different before notifying.",
47+
"INPC005:Check if value is different before notifying",
4848
Justification = "Reason...")]
4949
```
5050
<!-- end generated config severity -->

0 commit comments

Comments
 (0)