lib/rubocop/options.rb in rbhint-0.85.1.rc2 vs lib/rubocop/options.rb in rbhint-0.87.1.rc1

- old
+ new

@@ -161,19 +161,28 @@ option(opts, '--show-cops [COP1,COP2,...]') do |list| @options[:show_cops] = list.nil? ? [] : list.split(',') end end - # rubocop:disable Metrics/MethodLength + # rubocop:disable Metrics/MethodLength, Metrics/AbcSize def add_boolean_flags(opts) option(opts, '-F', '--fail-fast') option(opts, '-C', '--cache FLAG') option(opts, '-d', '--debug') option(opts, '-D', '--[no-]display-cop-names') option(opts, '-E', '--extra-details') option(opts, '-S', '--display-style-guide') - option(opts, '-a', '--auto-correct') + option(opts, '-a', '--auto-correct') do + @options[:safe_auto_correct] = true + end + option(opts, '--safe-auto-correct') do + warn '--safe-auto-correct is deprecated; use --auto-correct' + @options[:safe_auto_correct] = @options[:auto_correct] = true + end + option(opts, '-A', '--auto-correct-all') do + @options[:auto_correct] = true + end option(opts, '--disable-pending-cops') option(opts, '--enable-pending-cops') option(opts, '--ignore-disable-comments') option(opts, '--safe') @@ -182,11 +191,11 @@ option(opts, '-v', '--version') option(opts, '-V', '--verbose-version') option(opts, '-P', '--parallel') end - # rubocop:enable Metrics/MethodLength + # rubocop:enable Metrics/MethodLength, Metrics/AbcSize def add_aliases(opts) option(opts, '-l', '--lint') do @options[:only] ||= [] @options[:only] << 'Lint' @@ -194,13 +203,10 @@ option(opts, '-x', '--fix-layout') do @options[:only] ||= [] @options[:only] << 'Layout' @options[:auto_correct] = true end - option(opts, '--safe-auto-correct') do - @options[:auto_correct] = true - end end def add_list_options(opts) option(opts, '-L', '--list-target-files') end @@ -463,11 +469,12 @@ enable_pending_cops: 'Run with pending cops.', extra_details: 'Display extra details in offense messages.', lint: 'Run only lint cops.', safe: 'Run only safe cops.', list_target_files: 'List all files RuboCop will inspect.', - auto_correct: 'Auto-correct offenses.', - safe_auto_correct: 'Run auto-correct only when it\'s safe.', + auto_correct: 'Auto-correct offenses (only when it\'s safe).', + safe_auto_correct: '(same, deprecated)', + auto_correct_all: 'Auto-correct offenses (safe and unsafe)', fix_layout: 'Run only layout cops, with auto-correct on.', color: 'Force color output on or off.', version: 'Display version.', verbose_version: 'Display verbose version.', parallel: ['Use available CPUs to execute inspection in',