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

Commit c52f32b

Browse files
author
Lakshmi Priya Sekar
committed
Clean Console messages.
1 parent 7570f07 commit c52f32b

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

src/CodeFormatter/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private static int Main(string[] args)
1919
{
2020
if (args.Length < 1)
2121
{
22-
Console.WriteLine("CodeFormatter <project or solution> [<rule types>] [/file <filename>]");
22+
Console.WriteLine("CodeFormatter <project or solution> [<rule types>] [/file <filename>] [/nocopyright]");
2323
Console.WriteLine(" <rule types> - Rule types to use in addition to the default ones.");
2424
Console.WriteLine(" Use ConvertTests to convert MSTest tests to xUnit.");
2525
Console.WriteLine(" <filename> - Only apply changes to files with specified name.");

src/Microsoft.DotNet.CodeFormatting/FormattingEngineImplementation.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,7 @@ private void StartDocument()
161161
private void EndDocument(Document document)
162162
{
163163
_watch.Stop();
164-
if (_verbose && _watch.Elapsed.TotalSeconds > 1)
165-
{
166-
FormatLogger.WriteLine();
167-
FormatLogger.WriteLine(" {0} {1} seconds", document.Name, _watch.Elapsed.TotalSeconds);
168-
}
169-
else
170-
{
171-
FormatLogger.Write(".");
172-
}
164+
FormatLogger.WriteLine(" {0} {1} seconds", document.Name, _watch.Elapsed.TotalSeconds);
173165
}
174166

175167
/// <summary>
@@ -202,7 +194,6 @@ private async Task<Solution> RunSyntaxPass(Solution originalSolution, IReadOnlyL
202194
}
203195
}
204196

205-
FormatLogger.WriteLine();
206197
return currentSolution;
207198
}
208199

@@ -224,7 +215,6 @@ private async Task<Solution> RunLocalSemanticPass(Solution solution, IReadOnlyLi
224215
solution = await RunLocalSemanticPass(solution, documentIds, localSemanticRule, cancellationToken);
225216
}
226217

227-
FormatLogger.WriteLine();
228218
return solution;
229219
}
230220

@@ -251,7 +241,6 @@ private async Task<Solution> RunLocalSemanticPass(Solution originalSolution, IRe
251241
}
252242
}
253243

254-
FormatLogger.WriteLine();
255244
return currentSolution;
256245
}
257246

@@ -263,7 +252,6 @@ private async Task<Solution> RunGlobalSemanticPass(Solution solution, IReadOnlyL
263252
solution = await RunGlobalSemanticPass(solution, documentIds, globalSemanticRule, cancellationToken);
264253
}
265254

266-
FormatLogger.WriteLine();
267255
return solution;
268256
}
269257

@@ -284,7 +272,6 @@ private async Task<Solution> RunGlobalSemanticPass(Solution solution, IReadOnlyL
284272
EndDocument(document);
285273
}
286274

287-
FormatLogger.WriteLine();
288275
return solution;
289276
}
290277
}

src/Microsoft.DotNet.CodeFormatting/IFormatLogger.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ public void WriteLine(string format, params object[] args)
3131

3232
public void WriteErrorLine(string format, params object[] args)
3333
{
34+
Console.ForegroundColor = ConsoleColor.Red;
3435
Console.Write("Error: ");
3536
Console.WriteLine(format, args);
37+
Console.ResetColor();
3638
}
3739

3840
public void WriteLine()

0 commit comments

Comments
 (0)