Ruby source code analyzer (something like pylint)

后端 未结 7 1971
一整个雨季
一整个雨季 2020-12-04 11:47

Does Ruby have any tools along the lines of pylint for analyzing source code for errors and simple coding standards?

It would be nice if it could be integrated with

7条回答
  •  一生所求
    2020-12-04 12:00

    Check these out:

    • on Ruby Inside, an article presenting Towelie, Flay and Simian, all tools to find code duplication
      • Towelie
      • flay
      • Simian (a more general tool that supports Ruby among other languages)
    • reek: a code smell detector for Ruby
    • Roodi: checks the style of your Ruby code
    • flog: a code complexity analyzer
    • rcov: will give you a C0 (if I remember correctly) code coverage analysis. But be careful though. 100% coverage is very costly and doesn't mean perfect code.
    • heckle: changes your code in subtle manners and runs your test suite to see if it catches it. Brutal :-)

    Since they're all command-line tools they can all be integrated simply as cc.rb tasks. Just whip out your regex skillz to pick the important part of the output.

    I recommend you first try them out by hand to see if they play well with your codebase and if you like the info they give you. Once you find a few that give you value, then spend time integrating them in your cc.

提交回复
热议问题