fl3pp.Analyzers 0.0.4

dotnet add package fl3pp.Analyzers --version 0.0.4
                    
NuGet\Install-Package fl3pp.Analyzers -Version 0.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="fl3pp.Analyzers" Version="0.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="fl3pp.Analyzers" Version="0.0.4" />
                    
Directory.Packages.props
<PackageReference Include="fl3pp.Analyzers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add fl3pp.Analyzers --version 0.0.4
                    
#r "nuget: fl3pp.Analyzers, 0.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package fl3pp.Analyzers@0.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=fl3pp.Analyzers&version=0.0.4
                    
Install as a Cake Addin
#tool nuget:?package=fl3pp.Analyzers&version=0.0.4
                    
Install as a Cake Tool

fl3pp.Analyzers

A collection of analyzers I wished existed but didn't yet (or did, but in a form that I didn't like).

Installation

To install the analyzers, add the NuGet package to your .csproj:

<ItemGroup>
  <PackageReference Include="fl3pp.Analyzers" Version="0.0.4" PrivateAssets="all" />
</ItemGroup>

You can make use a Directory.Build.props to include the analyzers for all projects in a directory.

Note that all analyzers are disabled by default. You have two options to enable them:

<PropertyGroup>
  <EnableFl3ppAnalyzers>true</EnableFl3ppAnalyzers>
  
  <EnableFl3ppWhitespaceAnalyzers>true</EnableFl3ppWhitespaceAnalyzers>
  <EnableFl3ppMSTestAnalyzers>true</EnableFl3ppMSTestAnalyzers>
</PropertyGroup>

Whitespace Analyzers

FL30001: Maximum line length exceeded

Warns if a line exceeds the maximum line length.

Configuration:

[*.cs]
dotnet_diagnostic.FL30001.severity = warning # default: none
max_line_length = 100 # default: 120

The max_line_length option can be set to any positive integer. If not value is set, the guidelines option is used instead (for compatibility with the EditorGuidelines VS Extension). If no value can be found, a default value of 120 is used.

Example:

// .editorconfig: max_line_length = 20

/*                 | max length     */
/*                 |                */
class Test
{
    string a = "--";
    string b = "---";
//                  ^ warning
    string c = "-----";
//                  ^^^ warning
}
/*                 |                */

Available Fixes: None

FL30002: Trailing whitespace

Warns if a line contains trailing whitespace.

Configuration:

[*.cs]
dotnet_diagnostic.FL30002.severity = warning # default: none

Example:

class Test
//         ^ warning
{
    string a = "";
    string b = ""; 
//                ^ warning
    string c = "";   
//                ^^^ warning
}

Available Fixes: Trim trailing whitespace

FL30003: Consecutive empty lines

Warns if two or more consecutive line are empty.

Configuration:

[*.cs]
dotnet_diagnostic.FL30003.severity = warning # default: none

Example:


                        // warning
class Test
{
    
    string a = "";
    
                        // warning
    string c = "";   
}

Available Fixes: Remove consecutive empty lines

FL30004: Empty lines between matching consecutive braces

Warns if one or more empty lines are placed between two matching consecutive braces.

Configuration:

[*.cs]
dotnet_diagnostic.FL30004.severity = warning # default: none

Example:

class Test
{
 
    void Test()
    {
 
    }
                    // warning
}

Available Fixes: Remove empty lines between matching braces

MSTest Analyzers

FL30005: Missing optional TestContext argument

Warns if a method is called to which an optional TestContext argument is not passed, and proposes to add it. If possible, the TestContext property is added to the containing test class.

Configuration:

[*.cs]
dotnet_diagnostic.FL30005.severity = warning # default: none

Example:

class TestHelper(TestContext? testContext = null) { }

[TestClass]
public class Test
{
    // suggestion: public required TestContext TestContext { get; set; }; 
 
    [TestMethod]
    public void Test()
    {
        var testHelper = new TestHelper();
        // warning: Missing optional TestContext argument
        // suggestion: var testHelper = new TestHelper(TestContext);
    }
}

Available Fixes: None

  • Add TestContext argument
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.4 193 5/18/2025
0.0.4-pre1 177 4/30/2025
0.0.3 181 4/30/2025
0.0.3-pre2 191 4/23/2025
0.0.3-pre 202 4/22/2025
0.0.2 183 4/18/2025
0.0.1 235 4/16/2025