# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path("config/application", __dir__)

Supermarket::Application.load_tasks

if !Rails.env.production?
  require "chefstyle"
  require "rubocop/rake_task"

  desc "Run Chefstyle-flavored RuboCop"
  RuboCop::RakeTask.new(:chefstyle) do |task|
    task.verbose = false
  end

  task lint: :chefstyle
  task default: [:spec, :lint]
else
  require "cookstyle"
  require "rubocop/rake_task"

  desc "Run Cookstyle-flavored RuboCop"
  RuboCop::RakeTask.new(:cookstyle) do |task|
    task.options << "--display-cop-names"
  end

  task default: [:spec, :cookstyle]
end



