Skip to content

Commit 7a8ae00

Browse files
committed
Fix IDE0044 Make field readonly
1 parent 741c152 commit 7a8ae00

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/OrderingRules/UsingCodeFixProvider.TreeTextSpan.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ internal TreeTextSpan GetContainingSpan(TextSpan textSpan)
158158
internal class Builder
159159
{
160160
private readonly List<Builder> children = new List<Builder>();
161-
private int start;
161+
private readonly int start;
162162
private int end = int.MaxValue;
163163

164164
/// <summary>

StyleCop.Analyzers/StyleCop.Analyzers.Status.Generator/SolutionReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace StyleCop.Analyzers.Status.Generator
2424
/// </summary>
2525
public class SolutionReader
2626
{
27-
private static Regex diagnosticPathRegex = new Regex(@"(?<type>[A-Za-z]+)Rules\\(?<name>[A-Za-z0-9]+)\.cs$");
27+
private static readonly Regex diagnosticPathRegex = new Regex(@"(?<type>[A-Za-z]+)Rules\\(?<name>[A-Za-z0-9]+)\.cs$");
2828
private INamedTypeSymbol diagnosticAnalyzerTypeSymbol;
2929
private INamedTypeSymbol noCodeFixAttributeTypeSymbol;
3030

StyleCop.Analyzers/StyleCop.Analyzers/MaintainabilityRules/SA1412StoreFilesAsUtf8.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ internal class SA1412StoreFilesAsUtf8 : DiagnosticAnalyzer
3939

4040
private static readonly Action<SyntaxTreeAnalysisContext> SyntaxTreeAction = HandleSyntaxTree;
4141

42-
private static byte[] utf8Preamble = Encoding.UTF8.GetPreamble();
42+
private static readonly byte[] utf8Preamble = Encoding.UTF8.GetPreamble();
4343

4444
/// <summary>
4545
/// Gets the key for the detected encoding name in the <see cref="Diagnostic.Properties"/> collection.

0 commit comments

Comments
 (0)