This module does auto-correction of nodes that could become grammatically different after the correction. If the code change would alter the abstract syntax tree, it is not done.
# File lib/rubocop/cop/mixin/autocorrect_unless_changing_ast.rb, line 8 def autocorrect(node) c = correction(node) new_source = rewrite_node(node) # Make the correction only if it doesn't change the AST. fail CorrectionNotPossible if node != SourceParser.parse(new_source).ast @corrections << c end
Generated with the Darkfish Rdoc Generator 2.