Sha256: 522ac323e6dbbf34a003bbf7e812bf78ab3ea987217aa3ea7932101d5eb5cf91
Contents?: true
Size: 561 Bytes
Versions: 19
Compression:
Stored size: 561 Bytes
Contents
require 'roodi/checks/check' module Roodi module Checks # Checks to make sure for loops are not being used.. # # Using a for loop is not idiomatic use of Ruby, and is usually a sign that someone with # more experience in a different programming language is trying out Ruby. Use # Enumerable.each with a block instead. class ForLoopCheck < Check def interesting_nodes [:for] end def evaluate_start(node) add_error "Don't use 'for' loops. Use Enumerable.each instead." end end end end
Version data entries
19 entries across 19 versions & 3 rubygems