Skip to content
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

Support commented out code ie //// … to skip MEN002 #8

Closed
gaurav137 opened this issue Jul 26, 2022 · 2 comments
Closed

Support commented out code ie //// … to skip MEN002 #8

gaurav137 opened this issue Jul 26, 2022 · 2 comments

Comments

@gaurav137
Copy link

gaurav137 commented Jul 26, 2022

Commenting out blocks of code during development cycle ends up at times crossing the max line length limit set for MEN002. It would be great if a comment with four slashes ie //// can be ignored by this rule. This would be similar to https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1626.md which also allows for the same by differentiating normal code from commented code based on four slashes: “
When commenting out lines of code, it is advisable to begin the comment with four slashes to differentiate it from normal comments”.

Right now it gets painful to have to suppress this rule in code when commenting code shifts right and then remembering to remove suppression when uncommenting fixes the indentation to be within limits.

menees added a commit that referenced this issue Aug 6, 2022
Support AllowLongUriLines in the XML schema (missed in 28e705a).
@menees
Copy link
Owner

menees commented Aug 6, 2022

I've added optional support for this in v3.0.9. It's off by default, but you can enable it by setting AllowLongFourSlashCommentLines = true in Menees.Analyzers.Settings.xml.

It's off by default because I don't like commented out blocks of code, and I don't want to allow them to bypass any of my analyzer rules. I remove code instead of commenting it out, and I use source control to get back the old code if I ever need it again. I'm a fan of rules like Code Cracker's CC0037 that require commented out code to be removed.

@menees menees closed this as completed Aug 6, 2022
@gaurav137
Copy link
Author

We also avoid commented code from being checked in. This setting is helping in quickly commenting out blocks and doing F5 while debugging w/o worrying about going over the col limit due to such temporary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants