Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Commit e844f8e

Browse files
author
Lakshmi Priya Sekar
committed
Address code review feedback
1 parent dc69398 commit e844f8e

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/Microsoft.DotNet.CodeFormatting.Tests/CodeFormattingTestBase.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ internal static IFormattingRule GetDefaultVSFormatter()
2929
return new Rules.IsFormattedFormattingRule();
3030
}
3131

32-
internal static Solution CreateSolution(string[] sources, string language = LanguageNames.CSharp)
32+
private static Solution CreateSolution(string[] sources, string language = LanguageNames.CSharp)
3333
{
3434
string fileExtension = language == LanguageNames.CSharp ? CSharpFileExtension : VBFileExtension;
3535
var projectId = ProjectId.CreateNewId(TestProjectName);
@@ -52,7 +52,7 @@ internal static Solution CreateSolution(string[] sources, string language = Lang
5252
return solution;
5353
}
5454

55-
internal static async Task<Solution> Format(Solution solution, IFormattingRule rule)
55+
private static async Task<Solution> Format(Solution solution, IFormattingRule rule)
5656
{
5757
var documentIds = solution.Projects.SelectMany(p => p.DocumentIds);
5858

@@ -66,13 +66,13 @@ internal static async Task<Solution> Format(Solution solution, IFormattingRule r
6666
return solution;
6767
}
6868

69-
internal static async Task<Document> RewriteDocumentAsync(Document document, IFormattingRule rule)
69+
private static async Task<Document> RewriteDocumentAsync(Document document, IFormattingRule rule)
7070
{
7171
document = await rule.ProcessAsync(document, CancellationToken.None);
7272
return await GetDefaultVSFormatter().ProcessAsync(document, CancellationToken.None);
7373
}
7474

75-
internal static void AssertSolutionEqual(Solution expectedSolution, Solution actualSolution)
75+
private static void AssertSolutionEqual(Solution expectedSolution, Solution actualSolution)
7676
{
7777
var expectedDocuments = expectedSolution.Projects.SelectMany(p => p.Documents);
7878
var actualDocuments = actualSolution.Projects.SelectMany(p => p.Documents);
@@ -89,7 +89,7 @@ internal static void AssertSolutionEqual(Solution expectedSolution, Solution act
8989
}
9090
}
9191

92-
internal void Verify(string[] sources, string[] expected, IFormattingRule rule)
92+
private static void Verify(string[] sources, string[] expected, IFormattingRule rule)
9393
{
9494
var inputSolution = CreateSolution(sources);
9595
var expectedSolution = CreateSolution(expected);
@@ -101,12 +101,12 @@ internal void Verify(string[] sources, string[] expected, IFormattingRule rule)
101101
AssertSolutionEqual(expectedSolution, actualSolution);
102102
}
103103

104-
internal void Verify(string[] source, string[] expected)
104+
protected void Verify(string[] source, string[] expected)
105105
{
106106
Verify(source, expected, GetFormattingRule());
107107
}
108108

109-
internal void Verify(string source, string expected)
109+
protected void Verify(string source, string expected)
110110
{
111111
Verify(new string[] { source }, new string[] { expected });
112112
}

src/Microsoft.DotNet.CodeFormatting/Rules/HasUnderScoreInPrivateFieldNamesFormattingRule.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ private static string GetNewSymbolName(ISymbol symbol)
8787
{
8888
if (symbol.IsStatic)
8989
{
90-
if (symbol.GetType().Equals(typeof(Thread)))
90+
// Check for ThreadStatic private fields.
91+
if (symbol.GetAttributes().Any(a => a.AttributeClass.Name.Equals("ThreadStatic")))
9192
{
9293
if (!symbol.Name.StartsWith("t_"))
9394
return "t_" + symbol.Name;

0 commit comments

Comments
 (0)