Skip to content

Commit

Permalink
Change version to 1.8.2 (1.0.0-rc)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed May 2, 2018
1 parent 2e74ae4 commit 520d106
Show file tree
Hide file tree
Showing 43 changed files with 501 additions and 77 deletions.
12 changes: 12 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
### 1.8.2 (2018-05-02)

#### Analyzers

* Add analyzer [UsePatternMatchingInsteadOfIsAndCast](http://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1220.md) (RCS1220)
* Add analyzer [UsePatternMatchingInsteadOfAsAndNullCheck](http://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1221.md) (RCS1221)
* Add analyzer [MergePreprocessorDirectives](http://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1222.md) (RCS1222)

#### Code Fixes

* Add code fixes for CS0136, CS0210, CS1003, CS1624, and CS1983.

### 1.8.1 (2018-04-17)

#### Analyzers
Expand Down
34 changes: 31 additions & 3 deletions docs/analyzers/RCS1104.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,46 @@
| Supports Fade\-Out | \- |
| Supports Fade\-Out Analyzer | \- |

## Example
## Examples

### Code with Diagnostic

```csharp
bool x = condition ? true : false; // RCS1104
bool x = y ? true : false; // RCS1104
```

### Code with Fix

```csharp
bool x = condition;
bool x = y;
```

- - -

### Code with Diagnostic

```csharp
bool x = y ? z : false; // RCS1104
```

### Code with Fix

```csharp
bool x = y && z;
```

- - -

### Code with Diagnostic

```csharp
bool x = y ? true : z; // RCS1104
```

### Code with Fix

```csharp
bool x = y || z;
```

## How to Suppress
Expand Down
49 changes: 49 additions & 0 deletions docs/analyzers/RCS1220.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# RCS1220: Use pattern matching instead of combination of 'is' operator and cast operator

| Property | Value |
| --------------------------- | -------- |
| Id | RCS1220 |
| Category | Usage |
| Default Severity | Info |
| Enabled by Default | ✓ |
| Supports Fade\-Out | \- |
| Supports Fade\-Out Analyzer | \- |

## Example

### Code with Diagnostic

```csharp
if (x is T && Foo((T)x)) // RCS1220
{
}
```

### Code with Fix

```csharp
if (x is T y && Foo(y))
{
}
```

## How to Suppress

### SuppressMessageAttribute

```csharp
[assembly: SuppressMessage("Usage", "RCS1220:Use pattern matching instead of combination of 'is' operator and cast operator.", Justification = "<Pending>")]
```

### \#pragma

```csharp
#pragma warning disable RCS1220 // Use pattern matching instead of combination of 'is' operator and cast operator.
#pragma warning restore RCS1220 // Use pattern matching instead of combination of 'is' operator and cast operator.
```

### Ruleset

* [How to configure rule set](../HowToConfigureAnalyzers.md)

*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)*
53 changes: 53 additions & 0 deletions docs/analyzers/RCS1221.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# RCS1221: Use pattern matching instead of combination of 'as' operator and null check

| Property | Value |
| --------------------------- | -------- |
| Id | RCS1221 |
| Category | Usage |
| Default Severity | Info |
| Enabled by Default | &#x2713; |
| Supports Fade\-Out | \- |
| Supports Fade\-Out Analyzer | \- |

## Example

### Code with Diagnostic

```csharp
var y = x as Foo; // RCS1221
if (y == null)
{
return;
}
```

### Code with Fix

```csharp
if (!(x is Foo y))
{
return;
}
```

## How to Suppress

### SuppressMessageAttribute

```csharp
[assembly: SuppressMessage("Usage", "RCS1221:Use pattern matching instead of combination of 'as' operator and null check.", Justification = "<Pending>")]
```

### \#pragma

```csharp
#pragma warning disable RCS1221 // Use pattern matching instead of combination of 'as' operator and null check.
#pragma warning restore RCS1221 // Use pattern matching instead of combination of 'as' operator and null check.
```

### Ruleset

* [How to configure rule set](../HowToConfigureAnalyzers.md)

*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)*
46 changes: 46 additions & 0 deletions docs/analyzers/RCS1222.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# RCS1222: Merge preprocessor directives

| Property | Value |
| --------------------------- | ----------- |
| Id | RCS1222 |
| Category | Readability |
| Default Severity | Info |
| Enabled by Default | &#x2713; |
| Supports Fade\-Out | \- |
| Supports Fade\-Out Analyzer | \- |

## Example

### Code with Diagnostic

```csharp
#pragma warning disable CS0000
#pragma warning disable CS0001
```

### Code with Fix

```csharp
#pragma warning disable CS0000, CS0001
```

## How to Suppress

### SuppressMessageAttribute

```csharp
[assembly: SuppressMessage("Readability", "RCS1222:Merge preprocessor directives.", Justification = "<Pending>")]
```

### \#pragma

```csharp
#pragma warning disable RCS1222 // Merge preprocessor directives.
#pragma warning restore RCS1222 // Merge preprocessor directives.
```

### Ruleset

* [How to configure rule set](../HowToConfigureAnalyzers.md)

*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)*
2 changes: 2 additions & 0 deletions docs/cs/CS0136.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

## Code Fixes

* Remove parameter
* Replace variable declaration with assignment


*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)*
14 changes: 14 additions & 0 deletions docs/cs/CS1003.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# CS1003

| Property | Value |
| ---------------------- | ----------------------------------------------------------------- |
| Id | CS1003 |
| Title | Syntax error, 'char' expected\. |
| Severity | Error |
| Official Documentation | [link](http://docs.microsoft.com/en-us/dotnet/csharp/misc/cs1003) |

## Code Fixes

* Add missing comma

*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)*
14 changes: 14 additions & 0 deletions docs/cs/CS1624.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# CS1624

| Property | Value |
| ---------------------- | ------------------------------------------------------------------------------------------------------- |
| Id | CS1624 |
| Title | The body of 'identifier' cannot be an iterator block because 'type' is not an iterator interface type\. |
| Severity | Error |
| Official Documentation | [link](http://docs.microsoft.com/en-us/dotnet/csharp/misc/cs1624) |

## Code Fixes

* Change method return type

*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)*
13 changes: 13 additions & 0 deletions docs/cs/CS1983.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# CS1983

| Property | Value |
| -------- | ------------------------------------------------------------------- |
| Id | CS1983 |
| Title | The return type of an async method must be void, Task or Task\<T>\. |
| Severity | Error |

## Code Fixes

* Change method return type

*\(Generated with [DotMarkdown](http://github.com/JosefPihrt/DotMarkdown)\)*
2 changes: 1 addition & 1 deletion docs/refactorings/RR0004.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Id | RR0004 |
| Title | Add braces to switch section |
| Syntax | switch section |
| Span | statements |
| Span | case or default keyword |
| Enabled by Default | &#x2713; |

### Usage
Expand Down
2 changes: 1 addition & 1 deletion docs/refactorings/RR0005.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Id | RR0005 |
| Title | Add braces to switch sections |
| Syntax | switch statement |
| Span | switch keyword |
| Span | case or default keyword |
| Enabled by Default | &#x2713; |

### Usage
Expand Down
2 changes: 1 addition & 1 deletion docs/refactorings/RR0096.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Id | RR0096 |
| Title | Remove braces from switch section |
| Syntax | switch section |
| Span | block |
| Span | case or default keyword |
| Enabled by Default | &#x2713; |

### Usage
Expand Down
2 changes: 1 addition & 1 deletion docs/refactorings/RR0097.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Id | RR0097 |
| Title | Remove braces from switch sections |
| Syntax | switch statement |
| Span | switch keyword |
| Span | case or default keyword |
| Enabled by Default | &#x2713; |

### Usage
Expand Down
36 changes: 28 additions & 8 deletions docs/refactorings/RR0127.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
## Replace expression with constant value
## Inline constant value

| Property | Value |
| ------------------ | -------------------------------------- |
| Id | RR0127 |
| Title | Replace expression with constant value |
| Syntax | expression that has constant value |
| Enabled by Default | &#x2713; |
| Property | Value |
| ------------------ | ---------------------------------- |
| Id | RR0127 |
| Title | Inline constant value |
| Syntax | expression that has constant value |
| Enabled by Default | &#x2713; |

### Usage

![Replace expression with constant value](../../images/refactorings/ReplaceExpressionWithConstantValue.png)
#### Before

```csharp
public const string Value = "x";

void Foo()
{
string x = Value;
}
```

#### After

```csharp
public const string Value = "x";

void Foo()
{
string x = "x";
}
```

[full list of refactorings](Refactorings.md)

Expand Down
12 changes: 11 additions & 1 deletion docs/refactorings/RR0137.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@

### Usage

![Replace method group with lambda](../../images/refactorings/ReplaceMethodGroupWithLambda.png)
#### Before

```csharp
Func<object, object, object> func = Foo;
```

#### After

```csharp
Func<object, object, object> func = (f, g) => Foo(f, g)
```

[full list of refactorings](Refactorings.md)

Expand Down
Loading

0 comments on commit 520d106

Please sign in to comment.