-
Notifications
You must be signed in to change notification settings - Fork 511
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
SA1002 doesn't handle inline comments well #1426
Comments
💡 This method should probably be rewritten. public static int GetBitPattern(PType ptype)
{
// Since April, 2014
const int CurrentBitPattern = 0x100001;
// Before April, 2014
const int LegacyBitPattern = 0x11001;
return IsSpecial(ptype) ? LegacyBitPattern : CurrentBitPattern;
} |
Sure, but if teams wanted to discourage that behavior wouldn't that be more appropriate for a separate "don't use delimited comments in the middle of a line of code" rule instead of having rules like SA1002 misflag in those situations? |
I agree. We should only check immediately preceding spaces. 👍 |
@sharwell I was (pleasantly) surprised to find that classic SC doesn't report anything for the example at the top of this file. You were correct in thinking that you'd only get an error if you were to insert a space before the semi-colon. |
Example:
It wants to remove the space before the inline comment (starting with
/*since
).The text was updated successfully, but these errors were encountered: