Skip to content

Commit 4516b18

Browse files
committed
Change version to 2.9.0
1 parent 0db67f4 commit 4516b18

39 files changed

+411
-90
lines changed

ChangeLog.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,67 @@
1+
### 2.9.0 (2020-03-13)
2+
3+
* Switch to Roslyn 3.x libraries
4+
* Add `Directory.Build.props` file
5+
* Add open configuration commands to Command Palette (VS Code) ([PR](https://github.com/JosefPihrt/Roslynator/pull/648))
6+
7+
#### Bug Fixes
8+
9+
* Fix key duplication/handle camel case names in `omnisharp.json` ([PR](https://github.com/JosefPihrt/Roslynator/pull/645))
10+
* Use prefix unary operator instead of postfix unary operator ([RCS1089](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1089.md)) ([issue](https://github.com/JosefPihrt/Roslynator/issues/639))
11+
* Cast of `this` to its interface cannot be null ([RCS1202](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1202.md)) ([issue](https://github.com/JosefPihrt/Roslynator/issues/640))
12+
* Do not remove braces in switch section if it contains 'using variable' ([RCS1031](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1031.md)) ([issue](https://github.com/JosefPihrt/Roslynator/issues/632))
13+
14+
#### New Analyzers
15+
16+
* [RCS1242](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1242.md) (DoNotPassNonReadOnlyStructByReadOnlyReference).
17+
* [RCS1243](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1243.md) (DuplicateWordInComment).
18+
* [RCS1244](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1244.md) (SimplifyDefaultExpression).
19+
* [RCS1245](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1245.md) (SimplifyConditionalExpression2) ([issue](https://github.com/JosefPihrt/Roslynator/issues/612)).
20+
21+
#### Analyzers
22+
23+
* Disable analyzer [RCS1057](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1057.md) by default ([issue](https://github.com/JosefPihrt/Roslynator/issues/590)).
24+
* Merge analyzer [RCS1156](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1156.md) with [RCS1113](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1113.md) ([issue](https://github.com/JosefPihrt/Roslynator/issues/650)).
25+
* `x == ""` should be replaced with `string.IsNullOrEmpty(x)`
26+
* Improve analyzer [RCS1215](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1215.md) ([commit](https://github.com/JosefPihrt/Roslynator/commit/0fdd97f9a62463f8b004abeb17a8b8509374c35a)).
27+
* `x == double.NaN` should be replaced with `double.IsNaN(x)`
28+
* Enable [RCS1169](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1169.md) and [RCS1170](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1170.md) if the type is read-only struct ([commit](https://github.com/JosefPihrt/Roslynator/commit/f34e105433dbc65686369adf712b0b99d93eaef7)).
29+
* Improve analyzer [RCS1077](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1077.md) ([commit](https://github.com/JosefPihrt/Roslynator/commit/3ee275442cb16f6a9104b42d582ba7d76d6df88c)).
30+
* `x.OrderBy(y => y).Reverse()` can be simplified to `x.OrderByDescending(y => y)`
31+
* `x.SelectMany(y => y).Count()` can be simplified to `x.Sum(y => y.Count)` if `x` has `Count` or `Length` property
32+
* Improve analyzer [RCS1161](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1161.md) - Declare explicit enum value using `<<` operator ([commit](https://github.com/JosefPihrt/Roslynator/commit/6b78496efe1a2f2678f2ef2a71986e2bee006863)).
33+
* Improve analyzer [RCS1036](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1036.md) - remove empty line between documentation comment and declaration ([commit](https://github.com/JosefPihrt/Roslynator/commit/de0f1205671281679866e92edd9337a7416409e6)).
34+
* Improve analyzer [RCS1037](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1037.md) - remove trailing white-space from documentation comment ([commit](https://github.com/JosefPihrt/Roslynator/commit/c3f7d193ee37d04de7e2c698aab7f3e1e6350e80)).
35+
* Improve analyzer [RCS1143](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1143.md) ([commit](https://github.com/JosefPihrt/Roslynator/commit/4c4281ebdf8eb0aa1a77d5e5bfda71bc66cce1df))
36+
* `x?.M() ?? default(int?)` can be simplified to `x?.M()` if `x` is a nullable struct.
37+
* Improve analyzer [RCS1206](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1206.md) ([commit](https://github.com/JosefPihrt/Roslynator/commit/88dd4cea4df07f036a8296511410ccff70f8fefe))
38+
* `(x != null) ? x.M() : default(int?)` can be simplified to `x?.M()` if `x` is a nullable struct.
39+
140
### 2.3.1 (2020-01-20)
241

342
* Last release of package Roslynator.Analyzers (2.3.0) that references Roslyn 2.x (VS 2017)
443

544
### 2.3.0 (2019-12-28)
645

746
* Last release of Roslynator for VS 2017
47+
* Automatically update configuration in omnisharp.json (VS Code) ([PR](https://github.com/JosefPihrt/Roslynator/pull/623)).
848

949
### 2.2.1 (2019-10-26)
1050

1151
* Add set of formatting analyzers (RCS0...).
1252

1353
### 2.2.0 (2019-09-28)
1454

55+
* Enable configuration for non-Windows systems (VS Code).
56+
1557
#### Analyzers
1658

1759
* Disable analyzer [RCS1029](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1029.md) (FormatBinaryOperatorOnNextLine) by default.
1860

61+
## 2.1.4 (2019-08-13)
62+
63+
* Initial release of Roslynator for VS Code.
64+
1965
### 2.1.3 (2019-08-06)
2066

2167
#### Analyzers

docs/analyzers/RCS1057.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
| -------- | ---------- |
55
| Id | RCS1057 |
66
| Category | Formatting |
7-
| Severity | Info |
7+
| Severity | None |
88

99
## Example
1010

docs/analyzers/RCS1077.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,34 @@ enumerable.Any() ? enumerable.First() : default // RCS1077
218218
enumerable.FirstOrDefault()
219219
```
220220

221+
- - -
222+
223+
### Code with Diagnostic
224+
225+
```csharp
226+
enumerable.OrderBy(f => f).Reverse() // RCS1077
227+
```
228+
229+
### Code with Fix
230+
231+
```csharp
232+
enumerable.OrderByDescending()
233+
```
234+
235+
- - -
236+
237+
### Code with Diagnostic
238+
239+
```csharp
240+
enumerable.SelectMany(f => f.Items).Count() // RCS1077
241+
```
242+
243+
### Code with Fix
244+
245+
```csharp
246+
enumerable.Sum(f => f.Items.Count)
247+
```
248+
221249
## See Also
222250

223251
* [How to Suppress a Diagnostic](../HowToConfigureAnalyzers.md#how-to-suppress-a-diagnostic)

docs/analyzers/RCS1089.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| Category | Simplification |
77
| Severity | Info |
88

9-
## Example
9+
## Examples
1010

1111
### Code with Diagnostic
1212

@@ -20,6 +20,20 @@ i = i + 1; // RCS1089
2020
i++;
2121
```
2222

23+
- - -
24+
25+
### Code with Diagnostic
26+
27+
```csharp
28+
M(i + 1); // RCS1089
29+
```
30+
31+
### Code with Fix
32+
33+
```csharp
34+
M(++i);
35+
```
36+
2337
## See Also
2438

2539
* [How to Suppress a Diagnostic](../HowToConfigureAnalyzers.md#how-to-suppress-a-diagnostic)

docs/analyzers/RCS1104.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ bool x = y;
2424

2525
### Code with Diagnostic
2626

27+
```csharp
28+
bool x = y ? false : true; // RCS1104
29+
```
30+
31+
### Code with Fix
32+
33+
```csharp
34+
bool x = !y;
35+
```
36+
37+
- - -
38+
39+
### Code with Diagnostic
40+
2741
```csharp
2842
bool x = y ? z : false; // RCS1104
2943
```

docs/analyzers/RCS1113.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| Category | Usage |
77
| Severity | Info |
88

9-
## Example
9+
## Examples
1010

1111
### Code with Diagnostic
1212

@@ -24,8 +24,27 @@ if (string.IsNullOrEmpty(s))
2424
}
2525
```
2626

27+
- - -
28+
29+
### Code with Diagnostic
30+
31+
```csharp
32+
if (s == "") // RCS1113
33+
{
34+
}
35+
```
36+
37+
### Code with Fix
38+
39+
```csharp
40+
if (string.IsNullOrEmpty(s))
41+
{
42+
}
43+
```
44+
2745
## See Also
2846

47+
* [CA1820: Test for empty strings using string length](https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1820)
2948
* [How to Suppress a Diagnostic](../HowToConfigureAnalyzers.md#how-to-suppress-a-diagnostic)
3049

3150

docs/analyzers/RCS1156.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# RCS1156: Use string\.Length instead of comparison with empty string
1+
# \[deprecated\] RCS1156: Use string\.Length instead of comparison with empty string
22

33
| Property | Value |
44
| -------- | ------- |

docs/analyzers/RCS1215.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ if (items.Count < 0) // RCS1215
3535
}
3636
```
3737

38+
- - -
39+
40+
### Code with Diagnostic
41+
42+
```csharp
43+
x == double.NaN
44+
```
45+
46+
### Code with Fix
47+
48+
```csharp
49+
double.IsNaN(x)
50+
```
51+
3852
## See Also
3953

4054
* [How to Suppress a Diagnostic](../HowToConfigureAnalyzers.md#how-to-suppress-a-diagnostic)

docs/analyzers/RCS1242.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# RCS1242: Do not pass non\-read\-only struct by read\-only reference
2+
3+
| Property | Value |
4+
| ------------------------ | ----------- |
5+
| Id | RCS1242 |
6+
| Category | Performance |
7+
| Severity | Warning |
8+
| Minimal Language Version | 7\.2 |
9+
10+
## Example
11+
12+
### Code with Diagnostic
13+
14+
```csharp
15+
struct C
16+
{
17+
void M(in C c) // RCS1242
18+
{
19+
}
20+
}
21+
```
22+
23+
### Code with Fix
24+
25+
```csharp
26+
struct C
27+
{
28+
void M(C c)
29+
{
30+
}
31+
}
32+
```
33+
34+
## See Also
35+
36+
* [in parameter modifier (C# Reference)](https://docs.microsoft.com/dotnet/csharp/language-reference/keywords/in-parameter-modifier)
37+
* [The 'in'-modifier and the readonly structs in C#](https://devblogs.microsoft.com/premier-developer/the-in-modifier-and-the-readonly-structs-in-c/)
38+
* [How to Suppress a Diagnostic](../HowToConfigureAnalyzers.md#how-to-suppress-a-diagnostic)
39+
40+
41+
*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)*

docs/analyzers/RCS1243.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# RCS1243: Duplicate word in a comment
2+
3+
| Property | Value |
4+
| -------- | ------- |
5+
| Id | RCS1243 |
6+
| Category | General |
7+
| Severity | Info |
8+
9+
## Example
10+
11+
### Code with Diagnostic
12+
13+
```csharp
14+
/// <summary>
15+
/// This is the the comment.
16+
/// </summary>
17+
public class C
18+
{
19+
}
20+
```
21+
22+
### Code with Fix
23+
24+
```csharp
25+
/// <summary>
26+
/// This is the comment.
27+
/// </summary>
28+
public class C
29+
{
30+
}
31+
```
32+
33+
## See Also
34+
35+
* [How to Suppress a Diagnostic](../HowToConfigureAnalyzers.md#how-to-suppress-a-diagnostic)
36+
37+
38+
*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)*

0 commit comments

Comments
 (0)