Ruby / Rails的编码风格检查器或代码格式化程序 [英] Coding style checker or code formatter for Ruby / Rails

查看:136
本文介绍了Ruby / Rails的编码风格检查器或代码格式化程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用C#或Perl,有一些有用的工具,如StyleCop,FxCop,Perl :: Critic和Perltidy。他们可以自动检查或格式化我的代码。然后,有没有任何等效的工具的Ruby或Rails?我在Google上找到了一些工具,但我觉得他们没有这么频繁。

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 equivalent tools for Ruby or Rails? I found some tools on Google, but I felt they are not maintained so frequently.

推荐答案

Ruby工具箱,位于 https://www.ruby-toolbox.com/categories/code_metrics

There's some style checkers listed at in the Ruby toolbox at https://www.ruby-toolbox.com/categories/code_metrics .

此外,打开警告可以检查某些类型的错误代码。使用 $ VERBOSE = true 或使用此处列出

Also, turning on warnings can check for some kinds of bad code. Do so with $VERBOSE = true or by one of the ways listed here.

这篇关于Ruby / Rails的编码风格检查器或代码格式化程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆