-
Notifications
You must be signed in to change notification settings - Fork 25
/
Rakefile
50 lines (41 loc) · 1.33 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 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__)
Rails.application.load_tasks
# Load test tasks
begin
require 'rspec/core/rake_task'
require 'parallel_tests/tasks'
require 'haml_lint/rake_task'
require 'rubocop/rake_task'
require 'reek/rake/task'
RSpec::Core::RakeTask.new(:rspec)
HamlLint::RakeTask.new
RuboCop::RakeTask.new
Reek::Rake::Task.new
task rbp: [:environment] do
require 'rails_best_practices'
app_root = Rake.application.original_dir
analyzer = RailsBestPractices::Analyzer.new(app_root)
analyzer.analyze
analyzer.output
end
Rake::Task['test'].clear # Rails puts minitest on the test task automatically'
task lint: %w[rubocop haml_lint rbp reek]
task test: %w[parallel:spec lint]
task default: [:test]
rescue LoadError
puts 'Test tasks not available'
end
task log: [:environment] do
ActiveRecord::Base.logger = Logger.new($stdout)
end
namespace :codecov do
desc 'Uploads the latest simplecov result set to codecov.io'
task upload: :environment do
require 'simplecov'
require 'codecov'
formatter = SimpleCov::Formatter::Codecov.new
formatter.format(SimpleCov::ResultMerger.merged_result)
end
end