From: Robert Klemme Date: 2010-11-10T01:40:48+09:00 Subject: Re: Analyzer for errors in code ? On Tue, Nov 9, 2010 at 5:00 PM, David Unric wrote: > I would like to check a source code for common errors like use of unused > variables. The "ruby -c" only checks for syntax errors. > > Is there some tool for Ruby like pylint or pyflakes for Python ? > It has to _not_ run the code to do analysis. At least mistypos of method > and variable names would be enough. Unused local variables would be doable, but detection of typos of variable and method names is almost impossible without running the code. The reason is that the set of valid method names may change at will during the course of a programs execution. Plus, with #method_missing you can properly handle methods that are never ever defined. The usability of such a tool might be very limited. Having said that you may want to try ruby's command line option -w. See also http://stackoverflow.com/questions/1805146/where-can-i-find-an-actively-developed-lint-tool-for-ruby Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/