Add analyzer to detect commented code #311
ernestasjuska
started this conversation in
New Rule
Replies: 1 comment 1 reply
-
I like this rule! I'm doubting a bit on the verbs that this rule should check on, is this list below complete?
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Please add analyzer that can detect commented code. At least in our company, we have many programmers that are very used to old Navision practices and would rather comment out code than just delete it and use Git functionality.
Detecting code in comments could be troublesome because sometimes comments could contain examples and more importantly it would involve parsing.
I would suggest the opposite. Require the comments to be either documentation comments (starting with
///
) or "todo" style comments with format// TODO: My message here
(where TODO could beTODO
,FIXME
,NOTE
, etc.).Multiline "todo" comments can be either (examples from Todo Tree):
or
or
Also allow all comments following directly after the "todo" comment:
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions