Skip to content

Commit

Permalink
[ci] Update Rakefile for running splitted rubocop
Browse files Browse the repository at this point in the history
As rubocop configuration was splitted we need to modify the linter task
to run each rubocop configuration setup.

Co-authored-by: Björn Geuken <bgeuken@suse.de>
Co-authored-by: Ana María Martínez Gómez <ammartinez@suse.de>
  • Loading branch information
3 people committed Jun 22, 2018
1 parent 4341f34 commit 8b145ad
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/api/lib/tasks/dev.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require 'fileutils'
require 'yaml'
require 'rubocop/rake_task'

namespace :dev do
task :prepare, [:old_test_suite] do |_t, args|
Expand Down Expand Up @@ -72,15 +73,25 @@ namespace :dev do
desc 'Run all linters we use'
task :lint do
Rake::Task['haml_lint'].invoke
Rake::Task['dev:lint:ruby'].invoke
Rake::Task['dev:lint:rubocop:all'].invoke
sh 'jshint ./app/assets/javascripts/'
Rake::Task['db:structure:verify'].invoke
Rake::Task['db:structure:verify_no_bigint'].invoke
end
namespace :lint do
desc 'Run the ruby linter'
task :ruby do
sh 'rubocop -D -F -S --fail-level convention ../..'
namespace :rubocop do
task all: [:root, :rails] do
end
desc 'Run the ruby linter in rails'
RuboCop::RakeTask.new(:rails) do |task|
task.options = ['-D', '-F', '-S', '--fail-level', 'convention', '--ignore_parent_exclusion']
end
desc 'Run the ruby linter in root'
task :root do
Dir.chdir('../..') do
Rake::Task['dev:lint:rubocop:rails'].invoke
end
end
end
desc 'Run the haml linter'
task :haml do
Expand Down

0 comments on commit 8b145ad

Please sign in to comment.