mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Add Style enforcer (via Rubocop)
It will fail the build, but as it is currently, most of the cops are 'todos'. Great for new contributors.. :)
This commit is contained in:
17
Rakefile
17
Rakefile
@@ -1,9 +1,22 @@
|
||||
require "bundler/gem_tasks"
|
||||
require 'bundler/gem_tasks'
|
||||
|
||||
begin
|
||||
require 'rubocop'
|
||||
require 'rubocop/rake_task'
|
||||
rescue LoadError
|
||||
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
|
||||
end
|
||||
|
||||
require 'rake/testtask'
|
||||
|
||||
Rake::TestTask.new do |t|
|
||||
t.libs << "test"
|
||||
t.libs << 'test'
|
||||
t.test_files = FileList['test/**/*_test.rb']
|
||||
t.ruby_opts = ['-r./test/test_helper.rb']
|
||||
t.verbose = true
|
||||
|
||||
Reference in New Issue
Block a user