Class: Bankai::Generators::LintGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/bankai/generators/lint_generator.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Base

default_source_root

Instance Method Details

#configure_overcommitObject



9
10
11
# File 'lib/bankai/generators/lint_generator.rb', line 9

def configure_overcommit
  template 'overcommit.yml.erb', '.overcommit.yml'
end

#configure_rubocopObject



13
14
15
16
17
# File 'lib/bankai/generators/lint_generator.rb', line 13

def configure_rubocop
  return if Rails::VERSION::MAJOR >= 8

  template 'rubocop.yml.erb', '.rubocop.yml'
end

#install_overcommitObject



19
20
21
# File 'lib/bankai/generators/lint_generator.rb', line 19

def install_overcommit
  run 'bundle exec overcommit --install'
end

#rubocop_autocorrectObject



23
24
25
26
27
# File 'lib/bankai/generators/lint_generator.rb', line 23

def rubocop_autocorrect
  return if Rails::VERSION::MAJOR >= 8

  run 'bundle exec rubocop --auto-correct-all'
end

#rubocop_todoObject



29
30
31
32
33
# File 'lib/bankai/generators/lint_generator.rb', line 29

def rubocop_todo
  return if Rails::VERSION::MAJOR >= 8

  run 'bundle exec rubocop --auto-gen-config'
end