roslynator icon indicating copy to clipboard operation
roslynator copied to clipboard

Roslynator is a set of code analysis tools for C#, powered by Roslyn.

Results 209 roslynator issues
Sort by recently updated
recently updated
newest added

I could implement this in my own package, but it might be useful for other people, so I am creating an issue here. While dotnet format has a rule for...

Feature Request
Area-Analyzers

The span used to be empty causing the warning to only appear when building, and not in the IDE (at least for Rider) unless something like Error lens is active....

Using pattern matching for checking null values is preferrable, but not possible within LINQ queries and in all expressions. Thus, the rule should not be applied there. We are forced...

The PR contains: - Setting up indentation for *.xml files and disabling trimming of white spaces for Analyzers.xml. The reason is that when you do changes there IDE introduces undesirable...

```cs httpClient.DefaultRequestHeaders.UserAgent.Add( new ProductInfoHeaderValue( new ProductHeaderValue( "Example", typeof(InitCommand).Assembly!.GetName()!.Version!.ToString()))); // ^ Assembly is not null. ``` ```cs if (expression.Parameters.Count != 1 || expression.Parameters[0].Type != context.RuntimeTypes.Peek()!.Source) // Stack.Peek() returns a non-null value...

```cs public GraphQLException(params IError[] errors) { Errors = errors ?? []; // 'errors' is non-nullable } ``` ```cs // '_context' is non-nullable _context ??= completionContext; ``` ```cs // 'Handler' is...

It would be good if things like this were also flagged: ```cs // 'configureServices' is not null here. configureServices?.Invoke(services); ``` ```cs var pickle = input?.Pickles!.First()?.ButterPickle; // ^ ^ ``` etc.

```cs if (argument is { Prop: 123, }) // should be an issue when using the `omit` option { // ... } var x = argument switch { _ =>...

```cs int[] x = [1, 2, 3,]; // should be an issue when using the `omit` option ```

Fixes #1641 Hello, I am new to this project and to the Roslyn in general, this is my first contribution here. I hope I got the idea right.