Skip to content

Commit fdc3c4f

Browse files
authored
Merge pull request #338 from ruby-go-gem/feature/rubocop-on-rbs
Add rubocop-on-rbs
2 parents 0472410 + 17419c4 commit fdc3c4f

File tree

8 files changed

+22
-2
lines changed

8 files changed

+22
-2
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
plugins:
2+
- rubocop-on-rbs
3+
14
AllCops:
25
TargetRubyVersion: 3.3
36
NewCops: enable

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ group :development do
66
gem "rake"
77
gem "rubocop", require: false
88
gem "rubocop_auto_corrector", require: false
9+
gem "rubocop-on-rbs", require: false
910
gem "ruby_header_parser", ">= 0.4.2"
1011
gem "yard"
1112
end

Gemfile.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ GEM
116116
rubocop-ast (1.47.1)
117117
parser (>= 3.3.7.2)
118118
prism (~> 1.4)
119+
rubocop-on-rbs (1.8.0)
120+
lint_roller (~> 1.1)
121+
rbs (~> 3.5)
122+
rubocop (>= 1.72.1, < 2.0)
123+
zlib
119124
rubocop_auto_corrector (0.5.0)
120125
rubocop (>= 1.30.0)
121126
ruby-progressbar (1.13.0)
@@ -165,6 +170,7 @@ GEM
165170
parser (>= 3.3.0)
166171
uri (1.0.4)
167172
yard (0.9.37)
173+
zlib (3.2.2)
168174

169175
PLATFORMS
170176
arm64-darwin-23
@@ -179,6 +185,7 @@ DEPENDENCIES
179185
rspec-parameterized
180186
rspec-temp_dir
181187
rubocop
188+
rubocop-on-rbs
182189
rubocop_auto_corrector
183190
ruby_header_parser (>= 0.4.2)
184191
serverspec

_tasks/ruby.rake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
require "rubocop/rake_task"
44

5-
RuboCop::RakeTask.new("ruby:rubocop")
5+
RuboCop::RakeTask.new("ruby:rubocop") do |task|
6+
task.plugins << "rubocop-on-rbs"
7+
end
68

79
namespace :ruby do
810
namespace :example do

ruby/testdata/example/sig/example/test_rb_define_class_under.rbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Example
24
class TestRbDefineClassUnder
35
end
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
# frozen_string_literal: true
2+
13
module Example
2-
module TestRbDefineModuleUnder
4+
module TestRbDefineModuleUnder # rubocop:disable Style/Documentation
35
end
46
end

ruby/testdata/example/sig/example/tests.rbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ module Example
4040
def self.rb_define_const: (string name, untyped val) -> void
4141

4242
private
43+
4344
def nop_rb_define_private_method: () -> void
4445
end
4546
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# frozen_string_literal: true
2+
13
class TestRbDefineClass
24
end

0 commit comments

Comments
 (0)