Class: Hanamismith::Builders::Reek

Inherits:
Rubysmith::Builders::Reek
  • Object
show all
Defined in:
lib/hanamismith/builders/reek.rb

Overview

Builds project skeleton Reek code quality support.

Instance Method Summary collapse

Instance Method Details

#add_detectorsObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/hanamismith/builders/reek.rb', line 19

def add_detectors
  with_template.insert_after(
    /enabled:\sfalse\n/,
    <<~DETECTORS.gsub(/^/, "  ")
      TooManyStatements:
        exclude:
          - RackLoggerPatch#prepare_app_providers
      UtilityFunction:
        exclude:
          - SQLLoggerPatch#log_query
    DETECTORS
  )
end

#callObject



11
12
13
14
15
16
17
# File 'lib/hanamismith/builders/reek.rb', line 11

def call
  return false unless settings.build_reek

  super
  add_detectors
  true
end

#with_templateObject



33
34
35
# File 'lib/hanamismith/builders/reek.rb', line 33

def with_template
  builder.call settings.with(template_path: "%project_name%/.reek.yml.erb")
end