在哪里可以找到针对Ruby积极开发的lint工具? [英] Where can I find an actively developed lint tool for Ruby?

查看:89
本文介绍了在哪里可以找到针对Ruby积极开发的lint工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写的大多数代码是在Ruby中进行的,偶尔我会做一些错别字,这些错字只会在一段时间后被发现.当我让我的脚本运行长时间的任务并回到发现我有错字的时候,这很烦人.

Most of the code I write is in Ruby, and every once in a while, I make some typo which only gets caught after a while. This is irritating when I have my scripts running long tasks, and return to find I had a typo.

是否有针对Ruby积极开发的皮棉工具,可以帮助我克服这一问题?是否可以在可处理大量源文件的系统中使用它,其中一些是动态加载的?

Is there an actively developed lint tool for Ruby that could help me overcome this? Would it be possible to use it across a system that works with a lot of source files, some of them loaded dynamically?

以以下代码段为例:

a = 20
b = 30
puts c

要赢得赏金,请给我看一个工具,该工具将检测到未创建/未定义的c变量.

To win bounty, show me a tool that will detect the c variable as not created/undefined.

推荐答案

您可以提供响尾蛇Ruby 试试.它会对Ruby代码进行静态类型检查,因此会怪罪您使用了未定义的变量.

You could give Diamondback Ruby a try. It does a static typecheck of Ruby code, and will thus blame you for using an undefined variable.

尽管DRuby是一个正在进行的研究项目,但它对于小型,独立的Ruby脚本已经非常有效.当前,它无法开箱即用"地分析许多Ruby标准库.目前,他们正在努力输入Ruby on Rails(请参见他们的最新论文).

While DRuby is an ongoing research project, it already works quite well for small, self-contained Ruby scripts. Currently, it is unable to analyze much of the Ruby standard library "out-of-the-box". Currently they are working toward typing Ruby on Rails (see their most recent papers).

这篇关于在哪里可以找到针对Ruby积极开发的lint工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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