LineLengthGuard 1.4.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package LineLengthGuard --version 1.4.0
NuGet\Install-Package LineLengthGuard -Version 1.4.0
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="LineLengthGuard" Version="1.4.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LineLengthGuard" Version="1.4.0" />
<PackageReference Include="LineLengthGuard"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
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 LineLengthGuard --version 1.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LineLengthGuard, 1.4.0"
#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 LineLengthGuard@1.4.0
#: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=LineLengthGuard&version=1.4.0
#tool nuget:?package=LineLengthGuard&version=1.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Line Length Guard
Roslyn analyser that checks if the maximum line length is respected.
Rules
This analyser contains one single rule to achieve its objective:
Rule | Title | Description |
---|---|---|
LLG001 | Line too long | Ensures that lines are not longer than the maximum established value. It can be configured by settings. |
Settings
A LineLengthGuardSettings.json
file can be used to configure some settings of the analyser.
Available settings
Available settings are explained below:
Key | Description |
---|---|
AllowLongMethodNamesWithUnderscores | A value that indicates if method names that contain underscores are allowed to exceed the maximum line length. Its default value is false . |
ExcludedLineStarts | A collection of strings that make lines starting with any of them to be excluded from the analysis. Lines with any start are analysed by default. |
MaximumLineLength | Maximum number of characters that a line is allowed to have. Its default value is 120 . |
Importation
Settings file must be imported into the project to be analysed in this way:
<ItemGroup>
<AdditionalFiles Include="LineLengthGuardSettings.json" />
</ItemGroup>
Example
An example of settings file is the following:
{
"AllowLongMethodNamesWithUnderscores": false,
"ExcludedLineStarts": [
"// Filename: ",
"namespace "
],
"MaximumLineLength": 120
}
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 |
---|---|---|
4.2.0 | 164 | 2/17/2025 |
4.1.2 | 114 | 12/21/2024 |
4.1.1 | 120 | 11/27/2024 |
4.1.0 | 122 | 11/26/2024 |
4.0.0 | 117 | 11/25/2024 |
3.0.0 | 119 | 11/24/2024 |
2.0.3 | 148 | 10/14/2024 |
2.0.2 | 130 | 9/14/2024 |
2.0.1 | 138 | 9/11/2024 |
2.0.0 | 131 | 9/10/2024 |
1.4.0 | 132 | 9/9/2024 |
1.3.0 | 126 | 8/29/2024 |
1.2.1 | 127 | 8/27/2024 |
1.2.0 | 119 | 7/24/2024 |
1.1.0 | 119 | 7/11/2024 |
1.0.3 | 132 | 7/9/2024 |
1.0.2 | 123 | 7/2/2024 |
1.0.1 | 133 | 7/2/2024 |
1.0.0 | 138 | 7/2/2024 |