fl3pp.Analyzers
0.0.4
dotnet add package fl3pp.Analyzers --version 0.0.4
NuGet\Install-Package fl3pp.Analyzers -Version 0.0.4
<PackageReference Include="fl3pp.Analyzers" Version="0.0.4" />
<PackageVersion Include="fl3pp.Analyzers" Version="0.0.4" />
<PackageReference Include="fl3pp.Analyzers" />
paket add fl3pp.Analyzers --version 0.0.4
#r "nuget: fl3pp.Analyzers, 0.0.4"
#:package fl3pp.Analyzers@0.0.4
#addin nuget:?package=fl3pp.Analyzers&version=0.0.4
#tool nuget:?package=fl3pp.Analyzers&version=0.0.4
fl3pp.Analyzers
A collection of analyzers I wished existed but didn't yet (or did, but in a form that I didn't like).
- Whitespace analyzers
- MSTest analyzers
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:
- In your
.editorconfigfiles - Through these MSBuild properties:
<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
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 |