roslynator
roslynator copied to clipboard
Roslynator is a set of code analysis tools for C#, powered by Roslyn.
**Product and Version Used**: Roslynator 2.3.0 Visual Studio 16.4.4 **Steps to Reproduce**: Consider this Linq code running against a SQL database with a case sensitive collation. This is attempting to...
I met with similar situation like #402. 1. `` on the main part of the class. 2. `` on any additional partials that require separate documentation. RCS1139 displayed on the...
In cross-platform development (and probably at all), you should not use a hard-coded path. For example, ```csharp var path = @"paTh\To\subfOlder"; ``` Will not behave as expected on Linux. Each...
When introducing a local variable, I often find it useful to explicitly declare the type, rather than using the `var` keyword. This is especially true when I work with unfamiliar...
To complement [CS4014](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs4014) that detects `async` calls not `await`'ed, it could be nice to have an analyzer to detect implicit conversions from async delegates to sync ones. ```csharp async Task...
What is benefice between `Roslynator.Analyzers` and https://github.com/dotnet/roslyn-analyzers It's recommended work with both together?
**Product and Version Used**: 2.2.0+VS2019 16.4.0Preview1 **Steps to Reproduce**: 1. Create an csproj(`ClassLibrary2`) in VS, and modify to multi targetFrameworks ```xml netstandard2.0;net472 ``` 2. Create `Class1.cs` at `ClassLibrary2/NewFolder/Class1.cs`; 3. Add...
Calls to `ValueTuple.Create` can be simplified to just parens. Example: m_Base.TryGetValue(ValueTuple.Create(key1, key2), out value); return m_Base.Remove(ValueTuple.Create(key1, key2)); Simplified version m_Base.TryGetValue((key1, key2), out value); return m_Base.Remove((key1, key2));
**Product and Version Used**: Roslynator 2019 2.1.3 **Steps to Reproduce**: This analyzer does not apply to the following snippet ```C# int i = 0; while (i < 10) { Console.WriteLine(i);...
When a method that has a `CancellationToken` parameter calls another method without passing the cancellation token, it's usually a mistake. For instance: ```csharp private async Task FooAsync(CancellationToken cancellationToken = default)...