Skip to content

Commit 894e538

Browse files
authored
Add RuboCop rake task (#1189)
1 parent 08b5420 commit 894e538

File tree

1 file changed

+42
-5
lines changed

1 file changed

+42
-5
lines changed

Rakefile

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,36 @@
11
# frozen_string_literal: true
22

3-
require "bundler/gem_tasks"
3+
# Clean
4+
#
5+
# rake clean
6+
# rake clobber
7+
48
require "rake/clean"
59

6-
CLOBBER.include('doc', '.yardoc')
10+
CLOBBER.include("doc", ".yardoc")
711

8-
require "yard"
12+
# Bundler
13+
#
14+
# rake build
15+
# rake release
16+
17+
require "bundler/gem_tasks"
18+
19+
gemspec = Gem::Specification.load("money.gemspec")
20+
21+
# RuboCop
22+
#
23+
# rake rubocop
24+
25+
require "rubocop/rake_task"
926

10-
gemspec = Gem::Specification.load('money.gemspec')
27+
RuboCop::RakeTask.new
28+
29+
# Yard
30+
#
31+
# rake yard
32+
33+
require "yard"
1134

1235
YARD::Rake::YardocTask.new do |t|
1336
t.options << "--title" << gemspec.description
@@ -16,12 +39,21 @@ YARD::Rake::YardocTask.new do |t|
1639
t.options << "--markup-provider" << "redcarpet" unless RUBY_PLATFORM == "java"
1740
end
1841

42+
# RSpec
43+
#
44+
# rake spec
45+
1946
require "rspec/core/rake_task"
47+
2048
RSpec::Core::RakeTask.new(:spec) do |t|
2149
t.fail_on_error = false
2250
t.ruby_opts = "-w"
2351
end
2452

53+
# File permissions
54+
#
55+
# rake check_permissions
56+
2557
desc "Check file permissions"
2658
task :check_permissions do
2759
files = Dir.glob("**/*.rb")
@@ -40,5 +72,10 @@ end
4072
# rubocop:disable Rake/Desc
4173
task release: :check_permissions
4274
task spec: :check_permissions
43-
task default: :spec
4475
# rubocop:enable Rake/Desc
76+
77+
# Default task
78+
#
79+
# rake
80+
81+
task default: [:rubocop, :spec]

0 commit comments

Comments
 (0)