Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed Jan 16, 2022
1 parent d25890b commit 7ccfc7d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ private static void AnalyzeSimpleMemberAccessExpression(SyntaxNodeAnalysisContex

ConvertMethodGroupToAnonymousFunctionAnalysis.IsFixable(simpleMemberAccess, context.SemanticModel, context.CancellationToken);
}

#endif
private static bool ConvertToAnonymousFunction(SyntaxNodeAnalysisContext context)
{
return context.PreferAnonymousFunctionOrMethodGroup() == true;
Expand All @@ -719,7 +719,6 @@ private static bool ConvertToMethodGroup(SyntaxNodeAnalysisContext context)
{
return context.PreferAnonymousFunctionOrMethodGroup() == false;
}
#endif

private static void ReportAnonymousFunction(SyntaxNodeAnalysisContext context, AnonymousFunctionExpressionSyntax anonymousMethod)
{
Expand Down
2 changes: 1 addition & 1 deletion src/CSharp.Workspaces/CSharp/SyntaxInverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace Roslynator.CSharp
{
[Obsolete("SyntaxInverter is obsolete, use SyntaxLogicalInverter instead.")]
/// <summary>
/// Provides static methods for syntax inversion.
/// </summary>
[Obsolete("SyntaxInverter is obsolete, use SyntaxLogicalInverter instead.")]
public static class SyntaxInverter
{
/// <summary>
Expand Down
10 changes: 5 additions & 5 deletions src/CommandLine/Commands/LogicalLinesOfCodeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ private static void WriteMetrics(
Math.Max(totalPreprocessorDirectiveLines.Length, totalLines.Length))));

WriteLine(Verbosity.Minimal);
WriteLine($"{totalCodeLines.PadLeft(maxDigits)} {totalCodeLineCount / (double)totalLineCount,4:P0} logical lines of code", ConsoleColors.Green, Verbosity.Minimal);
WriteLine($"{totalWhitespaceLines.PadLeft(maxDigits)} {totalWhitespaceLineCount / (double)totalLineCount,4:P0} white-space lines", Verbosity.Minimal);
WriteLine($"{totalCommentLines.PadLeft(maxDigits)} {totalCommentLineCount / (double)totalLineCount,4:P0} comment lines", Verbosity.Minimal);
WriteLine($"{totalPreprocessorDirectiveLines.PadLeft(maxDigits)} {totalPreprocessorDirectiveLineCount / (double)totalLineCount,4:P0} preprocessor directive lines", Verbosity.Minimal);
WriteLine($"{totalLines.PadLeft(maxDigits)} {totalLineCount / (double)totalLineCount,4:P0} total lines", Verbosity.Minimal);
WriteLine($"{totalCodeLines.PadLeft(maxDigits)} {totalCodeLineCount / (double)totalLineCount,5:P0} logical lines of code", ConsoleColors.Green, Verbosity.Minimal);
WriteLine($"{totalWhitespaceLines.PadLeft(maxDigits)} {totalWhitespaceLineCount / (double)totalLineCount,5:P0} white-space lines", Verbosity.Minimal);
WriteLine($"{totalCommentLines.PadLeft(maxDigits)} {totalCommentLineCount / (double)totalLineCount,5:P0} comment lines", Verbosity.Minimal);
WriteLine($"{totalPreprocessorDirectiveLines.PadLeft(maxDigits)} {totalPreprocessorDirectiveLineCount / (double)totalLineCount,5:P0} preprocessor directive lines", Verbosity.Minimal);
WriteLine($"{totalLines.PadLeft(maxDigits)} {totalLineCount / (double)totalLineCount,5:P0} total lines", Verbosity.Minimal);
}

protected override void ProcessResults(IEnumerable<LinesOfCodeCommandResult> results)
Expand Down
12 changes: 6 additions & 6 deletions src/CommandLine/Commands/PhysicalLinesOfCodeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,26 +144,26 @@ private void WriteMetrics(int totalCodeLineCount, int totalBlockBoundaryLineCoun
|| !Options.IncludeComments
|| !Options.IncludePreprocessorDirectives)
{
WriteLine($"{totalCodeLines.PadLeft(maxDigits)} {totalCodeLineCount / (double)totalLineCount,4:P0} lines of code", ConsoleColors.Green, Verbosity.Minimal);
WriteLine($"{totalCodeLines.PadLeft(maxDigits)} {totalCodeLineCount / (double)totalLineCount,5:P0} lines of code", ConsoleColors.Green, Verbosity.Minimal);
}
else
{
WriteLine($"{totalCodeLines.PadLeft(maxDigits)} lines of code", ConsoleColors.Green, Verbosity.Minimal);
}

if (Options.IgnoreBlockBoundary)
WriteLine($"{totalBlockBoundaryLines.PadLeft(maxDigits)} {totalBlockBoundaryLineCount / (double)totalLineCount,4:P0} block boundary lines", Verbosity.Minimal);
WriteLine($"{totalBlockBoundaryLines.PadLeft(maxDigits)} {totalBlockBoundaryLineCount / (double)totalLineCount,5:P0} block boundary lines", Verbosity.Minimal);

if (!Options.IncludeWhitespace)
WriteLine($"{totalWhitespaceLines.PadLeft(maxDigits)} {totalWhitespaceLineCount / (double)totalLineCount,4:P0} white-space lines", Verbosity.Minimal);
WriteLine($"{totalWhitespaceLines.PadLeft(maxDigits)} {totalWhitespaceLineCount / (double)totalLineCount,5:P0} white-space lines", Verbosity.Minimal);

if (!Options.IncludeComments)
WriteLine($"{totalCommentLines.PadLeft(maxDigits)} {totalCommentLineCount / (double)totalLineCount,4:P0} comment lines", Verbosity.Minimal);
WriteLine($"{totalCommentLines.PadLeft(maxDigits)} {totalCommentLineCount / (double)totalLineCount,5:P0} comment lines", Verbosity.Minimal);

if (!Options.IncludePreprocessorDirectives)
WriteLine($"{totalPreprocessorDirectiveLines.PadLeft(maxDigits)} {totalPreprocessorDirectiveLineCount / (double)totalLineCount,4:P0} preprocessor directive lines", Verbosity.Minimal);
WriteLine($"{totalPreprocessorDirectiveLines.PadLeft(maxDigits)} {totalPreprocessorDirectiveLineCount / (double)totalLineCount,5:P0} preprocessor directive lines", Verbosity.Minimal);

WriteLine($"{totalLines.PadLeft(maxDigits)} {totalLineCount / (double)totalLineCount,4:P0} total lines", Verbosity.Minimal);
WriteLine($"{totalLines.PadLeft(maxDigits)} {totalLineCount / (double)totalLineCount,5:P0} total lines", Verbosity.Minimal);
}

protected override void ProcessResults(IEnumerable<LinesOfCodeCommandResult> results)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public sealed class CSharpTestOptions : TestOptions
/// <param name="metadataReferences"></param>
/// <param name="allowedCompilerDiagnosticIds"></param>
/// <param name="allowedCompilerDiagnosticSeverity"></param>
/// <param name="configOptions"></param>
public CSharpTestOptions(
CSharpCompilationOptions compilationOptions = null,
CSharpParseOptions parseOptions = null,
Expand Down
1 change: 1 addition & 0 deletions src/Tests/Testing.Common/Testing/TestOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public abstract class TestOptions
/// <param name="metadataReferences"></param>
/// <param name="allowedCompilerDiagnosticIds"></param>
/// <param name="allowedCompilerDiagnosticSeverity"></param>
/// <param name="configOptions"></param>
internal TestOptions(
IEnumerable<MetadataReference> metadataReferences = null,
IEnumerable<string> allowedCompilerDiagnosticIds = null,
Expand Down
4 changes: 2 additions & 2 deletions src/Workspaces.Core/Spelling/SpellingAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ internal sealed class SpellingAnalyzer
[SuppressMessage("MicrosoftCodeAnalysisReleaseTracking", "RS2008:Enable analyzer release tracking")]
public static readonly DiagnosticDescriptor DiagnosticDescriptor = new(
id: CommonDiagnosticIdentifiers.PossibleMisspellingOrTypo,
title: "Possible misspelling or typo.",
messageFormat: "Possible misspelling or typo in '{0}'.",
title: "Possible misspelling or typo",
messageFormat: "Possible misspelling or typo in '{0}'",
category: "Spelling",
defaultSeverity: DiagnosticSeverity.Info,
isEnabledByDefault: true,
Expand Down

0 comments on commit 7ccfc7d

Please sign in to comment.