Skip to content

Commit

Permalink
Relax the default settings for MEN018 min and group sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
menees committed Jun 5, 2024
1 parent 4ae3356 commit 663c8c3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ This software is CharityWare. If you use it, I ask that you donate something to
| MEN015 | Use Preferred Terms | Similar to the old FxCop [CA1726 rule](https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1726?view=vs-2019#rule-description) except this rule only checks single terms (not double terms). So it uses a slightly different set of [default preferred terms](https://github.com/menees/Analyzers/blob/172bf0b6820e143de28f2f43e712908179ca1073/src/Menees.Analyzers/Settings.cs#L53-L77) (omitting double terms like LogOn), and it includes Id as a preferred term over ID (per FxCop's [CA1709 rule](https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1709?view=vs-2019#rule-description)). |
| MEN016 | Avoid Top-Level Statements | C# [top-level statements](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/program-structure/top-level-statements) are only for toy/example programs and should be avoided in long-term code for [consistency and maintainability](https://github.com/dotnet/docs/issues/27420#issuecomment-988776134). |
| MEN017 | Remove Unused Private Setter | A private set accessor is not needed when an auto property is only assigned in the constructor. Inspired by [C# Essentials' Use Getter-Only Auto-Property](https://github.com/DustinCampbell/CSharpEssentials?tab=readme-ov-file#use-getter-only-auto-property). |
| MEN018 | Use Digit Separators | Numeric literals should use digit separators ('_' from C# 7) to improve readability. This applies to multi-byte hexadecimal literals, multi-nibble binary literals, and [integer](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types#integer-literals) or [real](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types#real-literals) literals >= 1000. |
| MEN018 | Use Digit Separators | Numeric literals should use digit separators ('_' from C# 7) to improve readability. This applies to hexadecimal, binary, and [integer](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types#integer-literals) or [real](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types#real-literals) literals. |
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<AssemblyOriginatorKeyFile>../Analyzers.snk</AssemblyOriginatorKeyFile>

<!-- NOTE: Change the version in Vsix\source.extension.vsixmanifest to match this! -->
<Version>3.2.1</Version>
<Version>3.2.2</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
6 changes: 3 additions & 3 deletions src/Menees.Analyzers/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ private Settings(XElement xml)

#region Private Properties

private (byte MinSize, byte GroupSize) DecimalSeparators { get; } = (5, 3); // Group Per-Thousand
private (byte MinSize, byte GroupSize) DecimalSeparators { get; } = (6, 3); // Group Per-Thousand

private (byte MinSize, byte GroupSize) HexadecimalSeparators { get; } = (5, 2); // Group Per-Byte
private (byte MinSize, byte GroupSize) HexadecimalSeparators { get; } = (8, 4); // Group Per-Word

private (byte MinSize, byte GroupSize) BinarySeparators { get; } = (6, 4); // Group Per-Nibble
private (byte MinSize, byte GroupSize) BinarySeparators { get; } = (8, 4); // Group Per-Nibble

#endregion

Expand Down

0 comments on commit 663c8c3

Please sign in to comment.