Writing CodeNarc rules
[email protected] Wed, 17 Aug 2016 14:48:09 -0400
| Newsgroups | gmane.org.user-groups.ajug.members |
|---|---|
| Message-ID | <OF4C3668FF.C934E2E1-ON85258012.00623FE7-85258012.00672F77@LocalDomain> |
Hello all. I am trying to write a CodeNarc rule and am struggling with just how to use the AST code visitor support (or anything else) to get were I want to go. Does anyone know of a resource that might be helpful? I have looked at all of the obvious ones from the CodeNarc site as well as the distributed rules, google searches, etc. If it helps, I am trying to write a rule that checks to make sure the body of particular methods consists entirely of a try/catch block where Exception is caught. I have gotten as far as verifying the first statement in the method is a try/catch statement using an AbstractMethodVisitor but am struggling a bit in figuring out how to make sure there is no statement following it in the method. Thanks for any insight. -Andrew Goodspeed --------------- "Of all our decision rules, the one that most transforms our thinking is the one that is missing today in most companies, a quantified cost of delay." -Don Reinertsen "[Regarding] our economic decisions...we are trying to improve them, not to make them perfect. We want to make better economic choices than we make today, and today, this bar is set very low. We simply do not need perfect analysis." -Don Reinertsen NOTICE: This message and all attachments transmitted with it may contain sensitive and/or confidential information intended solely for the use of the addressee. If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete this message and all copies and backups thereof. If you choose to communicate with us by email, you should be aware that the security of incoming Internet email is not secure. We strongly encourage you to use encrypted email when sending sensitive and/or confidential information. By sending sensitive or confidential email messages that are not encrypted, you accept the risks of such lack of security and possible lack of confidentiality. If you elect to communicate from your workplace computer, you also should be aware that your employer and its agents have access to email communications between you and us. _______________________________________________ ajug-members mailing list [email protected] Manage your subscription and unsubscribe http://lists.ajug.org/mailman/listinfo/ajug-members