diff --git a/src/Microsoft.DotNet.CodeFormatting/Rules/CopyrightHeaderRule.CSharp.cs b/src/Microsoft.DotNet.CodeFormatting/Rules/CopyrightHeaderRule.CSharp.cs index df0be36b..ffd264db 100644 --- a/src/Microsoft.DotNet.CodeFormatting/Rules/CopyrightHeaderRule.CSharp.cs +++ b/src/Microsoft.DotNet.CodeFormatting/Rules/CopyrightHeaderRule.CSharp.cs @@ -45,7 +45,7 @@ protected override bool IsNewLine(SyntaxTrivia trivia) protected override SyntaxTrivia CreateLineComment(string commentText) { - return SyntaxFactory.Comment("// " + commentText); + return SyntaxFactory.Comment("//" + commentText); } protected override SyntaxTrivia CreateNewLine() diff --git a/src/Microsoft.DotNet.CodeFormatting/Rules/CopyrightHeaderRule.VisualBasic.cs b/src/Microsoft.DotNet.CodeFormatting/Rules/CopyrightHeaderRule.VisualBasic.cs index f19d27cf..3915105f 100644 --- a/src/Microsoft.DotNet.CodeFormatting/Rules/CopyrightHeaderRule.VisualBasic.cs +++ b/src/Microsoft.DotNet.CodeFormatting/Rules/CopyrightHeaderRule.VisualBasic.cs @@ -44,7 +44,7 @@ protected override bool IsNewLine(SyntaxTrivia trivia) protected override SyntaxTrivia CreateLineComment(string commentText) { - return SyntaxFactory.CommentTrivia("' " + commentText); + return SyntaxFactory.CommentTrivia("'" + commentText); } protected override SyntaxTrivia CreateNewLine() diff --git a/src/Microsoft.DotNet.CodeFormatting/Rules/CopyrightHeaderRule.cs b/src/Microsoft.DotNet.CodeFormatting/Rules/CopyrightHeaderRule.cs index f297bfea..5b092ad5 100644 --- a/src/Microsoft.DotNet.CodeFormatting/Rules/CopyrightHeaderRule.cs +++ b/src/Microsoft.DotNet.CodeFormatting/Rules/CopyrightHeaderRule.cs @@ -190,15 +190,15 @@ private static string GetCommentText(string line) { if (line.StartsWith("'")) { - return line.Substring(1).TrimStart(); + return line.Substring(1); } if (line.StartsWith("//")) { - return line.Substring(2).TrimStart(); + return line.Substring(2); } - return line; + return " " + line; } public override bool SupportsLanguage(string languageName)