module RenuoBinCheck::DefaultScripts

rubocop:disable Metrics/ModuleLength

Public Class Methods

brakeman(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 122
def brakeman(bin_check)
  bin_check.check do |config|
    config.command 'bundle exec brakeman -q -z --summary > /dev/null'
  end
end
coffeelint(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 115
def coffeelint(bin_check)
  bin_check.check do |config|
    config.command 'coffeelint -f .coffeelint.json app/assets/javascripts/**/*.coffee'
    config.files ['app/assets/javascripts/**/*.coffee']
  end
end
console_log(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 47
def console_log(bin_check)
  bin_check.check do |config|
    config.command "grep -i -r 'console.log' app spec"
    config.reversed_exit true
    config.files ['app/**/*', 'spec/**/*']
  end
end
mini_profiler(bin_check) click to toggle source

rubocop:enable Metrics/AbcSize rubocop:enable Metrics/MethodLength

# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 30
def mini_profiler(bin_check)
  bin_check.check do |config|
    config.command "grep 'rack-mini-profiler' Gemfile.lock >> /dev/null"
    config.reversed_exit true
    config.files ['Gemfile.lock']
  end
end
p_with_brackets(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 79
def p_with_brackets(bin_check)
  bin_check.check do |config|
    config.command "grep -i -r '  p(' app spec"
    config.reversed_exit true
    config.files ['app/**/*', 'spec/**/*']
  end
end
pp_and_p(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 71
def pp_and_p(bin_check)
  bin_check.check do |config|
    config.command "grep -i -r '(  pp? [^=])|(= pp? )' app spec"
    config.reversed_exit true
    config.files ['app/**/*', 'spec/**/*']
  end
end
put_with_brackets(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 63
def put_with_brackets(bin_check)
  bin_check.check do |config|
    config.command "grep -i -r '  puts(' app spec"
    config.reversed_exit true
    config.files ['app/**/*', 'spec/**/*']
  end
end
put_without_brackets(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 55
def put_without_brackets(bin_check)
  bin_check.check do |config|
    config.command "grep -i -r '  puts ' app spec"
    config.reversed_exit true
    config.files ['app/**/*', 'spec/**/*']
  end
end
rails() click to toggle source

rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength :reek: TooManyStatements

# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 7
def rails
  bin_check = RenuoBinCheck::Initializer.new

  mini_profiler(bin_check)
  todo(bin_check)
  console_log(bin_check)
  put_without_brackets(bin_check)
  put_with_brackets(bin_check)
  pp_and_p(bin_check)
  p_with_brackets(bin_check)
  rubocop_autocorrect(bin_check)
  slim_lint(bin_check)
  scss_lint(bin_check)
  tslint(bin_check)
  brakeman(bin_check)
  reek(bin_check)
  rspec(bin_check)

  bin_check.run
end
reek(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 128
def reek(bin_check)
  bin_check.check do |config|
    config.command 'bundle exec reek'
    config.files ['app/**/*.rb']
  end
end
rspec(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 135
def rspec(bin_check)
  bin_check.check do |config|
    config.command 'bundle exec rspec'
    config.files ['app/**/*.rb', 'spec/**/*.rb']
  end
end
rubocop_autocorrect(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 87
def rubocop_autocorrect(bin_check)
  bin_check.check do |config|
    config.command 'bundle exec rubocop -a -D -c .rubocop.yml'
    config.files ['app/**/*.rb', 'spec/**/*.rb']
  end
end
scss_lint(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 101
def scss_lint(bin_check)
  bin_check.check do |config|
    config.command 'scss-lint app/assets/stylesheets/**/*.scss'
    config.files ['app/assets/stylesheets/**/*.scss']
  end
end
slim_lint(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 94
def slim_lint(bin_check)
  bin_check.check do |config|
    config.command 'bundle exec slim-lint app/views/ -c .slim-lint.yml'
    config.files ['app/views/**/*.slim']
  end
end
todo(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 38
def todo(bin_check)
  bin_check.check do |config|
    config.command "grep --exclude-dir='app/assets/typings/**' -i -r 'TODO' app spec config db Rakefile README.md"\
    ' Gemfile'
    config.reversed_exit true
    config.files ['app/**/*', 'spec/**/*', 'config/**/*', 'db/**/*', 'Rakefile', 'README.md', 'Gemfile']
  end
end
tslint(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 108
def tslint(bin_check)
  bin_check.check do |config|
    config.command 'tslint -c tslint.json app/assets/javascripts/**/*.ts'
    config.files ['app/assets/javascripts/**/*.ts']
  end
end

Private Instance Methods

brakeman(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 122
def brakeman(bin_check)
  bin_check.check do |config|
    config.command 'bundle exec brakeman -q -z --summary > /dev/null'
  end
end
coffeelint(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 115
def coffeelint(bin_check)
  bin_check.check do |config|
    config.command 'coffeelint -f .coffeelint.json app/assets/javascripts/**/*.coffee'
    config.files ['app/assets/javascripts/**/*.coffee']
  end
end
console_log(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 47
def console_log(bin_check)
  bin_check.check do |config|
    config.command "grep -i -r 'console.log' app spec"
    config.reversed_exit true
    config.files ['app/**/*', 'spec/**/*']
  end
end
mini_profiler(bin_check) click to toggle source

rubocop:enable Metrics/AbcSize rubocop:enable Metrics/MethodLength

# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 30
def mini_profiler(bin_check)
  bin_check.check do |config|
    config.command "grep 'rack-mini-profiler' Gemfile.lock >> /dev/null"
    config.reversed_exit true
    config.files ['Gemfile.lock']
  end
end
p_with_brackets(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 79
def p_with_brackets(bin_check)
  bin_check.check do |config|
    config.command "grep -i -r '  p(' app spec"
    config.reversed_exit true
    config.files ['app/**/*', 'spec/**/*']
  end
end
pp_and_p(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 71
def pp_and_p(bin_check)
  bin_check.check do |config|
    config.command "grep -i -r '(  pp? [^=])|(= pp? )' app spec"
    config.reversed_exit true
    config.files ['app/**/*', 'spec/**/*']
  end
end
put_with_brackets(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 63
def put_with_brackets(bin_check)
  bin_check.check do |config|
    config.command "grep -i -r '  puts(' app spec"
    config.reversed_exit true
    config.files ['app/**/*', 'spec/**/*']
  end
end
put_without_brackets(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 55
def put_without_brackets(bin_check)
  bin_check.check do |config|
    config.command "grep -i -r '  puts ' app spec"
    config.reversed_exit true
    config.files ['app/**/*', 'spec/**/*']
  end
end
rails() click to toggle source

rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength :reek: TooManyStatements

# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 7
def rails
  bin_check = RenuoBinCheck::Initializer.new

  mini_profiler(bin_check)
  todo(bin_check)
  console_log(bin_check)
  put_without_brackets(bin_check)
  put_with_brackets(bin_check)
  pp_and_p(bin_check)
  p_with_brackets(bin_check)
  rubocop_autocorrect(bin_check)
  slim_lint(bin_check)
  scss_lint(bin_check)
  tslint(bin_check)
  brakeman(bin_check)
  reek(bin_check)
  rspec(bin_check)

  bin_check.run
end
reek(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 128
def reek(bin_check)
  bin_check.check do |config|
    config.command 'bundle exec reek'
    config.files ['app/**/*.rb']
  end
end
rspec(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 135
def rspec(bin_check)
  bin_check.check do |config|
    config.command 'bundle exec rspec'
    config.files ['app/**/*.rb', 'spec/**/*.rb']
  end
end
rubocop_autocorrect(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 87
def rubocop_autocorrect(bin_check)
  bin_check.check do |config|
    config.command 'bundle exec rubocop -a -D -c .rubocop.yml'
    config.files ['app/**/*.rb', 'spec/**/*.rb']
  end
end
scss_lint(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 101
def scss_lint(bin_check)
  bin_check.check do |config|
    config.command 'scss-lint app/assets/stylesheets/**/*.scss'
    config.files ['app/assets/stylesheets/**/*.scss']
  end
end
slim_lint(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 94
def slim_lint(bin_check)
  bin_check.check do |config|
    config.command 'bundle exec slim-lint app/views/ -c .slim-lint.yml'
    config.files ['app/views/**/*.slim']
  end
end
todo(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 38
def todo(bin_check)
  bin_check.check do |config|
    config.command "grep --exclude-dir='app/assets/typings/**' -i -r 'TODO' app spec config db Rakefile README.md"\
    ' Gemfile'
    config.reversed_exit true
    config.files ['app/**/*', 'spec/**/*', 'config/**/*', 'db/**/*', 'Rakefile', 'README.md', 'Gemfile']
  end
end
tslint(bin_check) click to toggle source
# File lib/renuo_bin_check/default_scripts/default_rails.rb, line 108
def tslint(bin_check)
  bin_check.check do |config|
    config.command 'tslint -c tslint.json app/assets/javascripts/**/*.ts'
    config.files ['app/assets/javascripts/**/*.ts']
  end
end