Coding style checker or code formatter for Ruby / Rails

后端 未结 3 974
挽巷
挽巷 2020-12-14 02:56

When I use C# or Perl, there are some useful tools like StyleCop, FxCop, Perl::Critic and Perltidy. They can check or format my code automatically. Then, are there any equiv

3条回答
  •  隐瞒了意图╮
    2020-12-14 03:29

    As for code checkers, http://ruby.sadi.st/Ruby_Sadist.html is a good collection of libraries. Worth mentioning in addition to the ruby toolbox since they're often used together (and written by the same group of people).

    As for formatters, every so often I go looking to see if any have come up, but the answer is still no. Other than auto-indenting, which any worthy editor can do or has a plugin for already, no formatters exist to my knowledge. I've heard people attribute it to ruby being hard to parse, but ruby parsers do exist, so who knows why this is.

提交回复
热议问题