require "rubocop/rake_task"

file_pattern = [
  "**/*.rb",
  "**/*.rake",
  "**/Rakefile",
  "**/Gemfile"
]

desc "Run RuboCop"
RuboCop::RakeTask.new(:rubocop) do |task|
  puts "[rake] Running RuboCop..."
  task.patterns = file_pattern
  task.options = [
    "-c", ".rubocop.yml"
  ]
  # Abort rake on failure
  task.fail_on_error = true
end
