mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Separate default rake from rake ci
This commit is contained in:
25
Rakefile
25
Rakefile
@@ -11,19 +11,27 @@ begin
|
||||
rescue LoadError
|
||||
else
|
||||
Rake::Task[:rubocop].clear if Rake::Task.task_defined?(:rubocop)
|
||||
if !defined?(::Rubinius)
|
||||
require 'rbconfig'
|
||||
# https://github.com/bundler/bundler/blob/1b3eb2465a/lib/bundler/constants.rb#L2
|
||||
windows_platforms = /(msdos|mswin|djgpp|mingw)/
|
||||
if RbConfig::CONFIG['host_os'] =~ windows_platforms
|
||||
desc 'No-op rubocop on Windows-- unsupported platform'
|
||||
task :rubocop do
|
||||
puts 'Skipping rubocop on Windows'
|
||||
end
|
||||
elsif defined?(::Rubinius)
|
||||
desc 'No-op rubocop to avoid rbx segfault'
|
||||
task :rubocop do
|
||||
puts 'Skipping rubocop on rbx due to segfault'
|
||||
puts 'https://github.com/rubinius/rubinius/issues/3499'
|
||||
end
|
||||
else
|
||||
Rake::Task[:rubocop].clear if Rake::Task.task_defined?(:rubocop)
|
||||
desc 'Execute rubocop'
|
||||
RuboCop::RakeTask.new(:rubocop) do |task|
|
||||
task.options = ['--rails', '--display-cop-names', '--display-style-guide']
|
||||
task.fail_on_error = true
|
||||
end
|
||||
else
|
||||
desc 'No-op rubocop to avoid rbx segfault'
|
||||
task :rubocop do
|
||||
puts 'Skipping rubocop on rbx due to segfault'
|
||||
puts 'https://github.com/rubinius/rubinius/issues/3499'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -37,3 +45,6 @@ Rake::TestTask.new do |t|
|
||||
end
|
||||
|
||||
task default: [:test, :rubocop]
|
||||
|
||||
desc 'CI test task'
|
||||
task :ci => [:default]
|
||||
|
||||
Reference in New Issue
Block a user