Class: RubocopChallenger::Go

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop_challenger/go.rb

Overview

Executes Rubocop Challenge flow

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Go

Returns a new instance of Go.

Parameters:

  • options (Hash)

    Options for the rubocop challenge

  • exclude-limit (Hash)

    a customizable set of options

  • auto-gen-timestamp (Hash)

    a customizable set of options

  • offense_counts (Hash)

    a customizable set of options

  • only-safe-autocorrect (Hash)

    a customizable set of options

  • name (Hash)

    a customizable set of options

  • email (Hash)

    a customizable set of options

  • labels (Hash)

    a customizable set of options

  • no-create-pr (Hash)

    a customizable set of options

  • project_column_name (Hash)

    a customizable set of options

  • project_id (Hash)

    a customizable set of options

  • verbose (Hash)

    a customizable set of options



33
34
35
# File 'lib/rubocop_challenger/go.rb', line 33

def initialize(options)
  @options = options
end

Instance Method Details

#execObject

Executes Rubocop Challenge flow

Raises:



41
42
43
44
45
46
47
48
# File 'lib/rubocop_challenger/go.rb', line 41

def exec
  update_rubocop!
  before_version, after_version = regenerate_rubocop_todo!
  corrected_rule = rubocop_challenge!(before_version, after_version)
  regenerate_rubocop_todo!
  add_to_ignore_list_if_challenge_is_incomplete(corrected_rule)
  create_pull_request!(corrected_rule)
end