Sha256: c86c771e94a284ce679c64f2245c21e70cc9787170c16bc724ba58959d3f9a0f
Contents?: true
Size: 638 Bytes
Versions: 9
Compression:
Stored size: 638 Bytes
Contents
# encoding: utf-8 module RuboCop module Cop # This module encapsulates the logic for autocorrect behaviour for a cop module AutocorrectLogic def autocorrect? autocorrect_requested? && support_autocorrect? && autocorrect_enabled? end def autocorrect_requested? @options.fetch(:auto_correct, false) end def support_autocorrect? respond_to?(:autocorrect, true) end def autocorrect_enabled? # allow turning off autocorrect on a cop by cop basis return true unless cop_config cop_config['AutoCorrect'] != false end end end end
Version data entries
9 entries across 9 versions & 1 rubygems