-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update resource analyzers to flag leading and trailing whitespaces #3973
Conversation
var additionalFileText = @" | ||
<root> | ||
<data name=""AnalyzerMessage1"" xml:space=""preserve""> | ||
<value>Message with trailing whitespace </value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add another scenario where trailing spaces are after a period, similar to the case caught in the original PR, say Message with trailing whitespaces after a period.
? I have a feeling your current logic might be need to be tweaked to move whitespace fixing part above multi-line fixing part.
@@ -605,6 +610,8 @@ private static void AnalyzeMessageCore(string message, IArgumentOperation argume | |||
fixedMessage = endsWithPeriod ? RemoveTrailingPeriod(fixedMessage) : fixedMessage + "."; | |||
} | |||
|
|||
fixedMessage = hasLeadingOrTrailingWhitespaces ? RemoveLeadingAndTrailingWhitespaces(fixedMessage) : fixedMessage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might have to move ahead to just after we fix line returns but before the above if statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. Please add the recommended unit test, and check if your current logic needs to be tweaked or not for that test.
Codecov Report
@@ Coverage Diff @@
## master #3973 +/- ##
==========================================
+ Coverage 95.61% 95.63% +0.01%
==========================================
Files 1155 1155
Lines 254900 255462 +562
Branches 15272 15282 +10
==========================================
+ Hits 243724 244299 +575
+ Misses 9215 9214 -1
+ Partials 1961 1949 -12 |
Fix #3958