Skip to content

Commit eed2e3e

Browse files
authored
Merge pull request #2662 from natalie-lang/remove-rubocop-comments
2 parents aff215a + 5050490 commit eed2e3e

18 files changed

+28
-29
lines changed

CONTRIBUTING.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ direction. If you are not sure about this, open an issue first so we can discuss
1010

1111
## Code Formatting
1212

13-
- Use `clang-format` to automatically format C++ files. You can run `rake format`.
14-
- Use `rubocop` to keep Ruby style and usage consistent.
13+
- Use `clang-format` to automatically format C++ files and `syntax_tree` for Ruby files. You can run `rake format`.
1514

1615
## Tests
1716

Rakefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -357,16 +357,16 @@ end
357357
# # # # Build Compile Database # # # #
358358

359359
if system('command -v compiledb 2>&1 >/dev/null')
360-
$compiledb_out = [] # rubocop:disable Style/GlobalVars
360+
$compiledb_out = []
361361

362362
def $stderr.puts(str)
363363
write(str + "\n")
364-
$compiledb_out << str # rubocop:disable Style/GlobalVars
364+
$compiledb_out << str
365365
end
366366

367367
task :write_compile_database do
368-
if $compiledb_out.any? # rubocop:disable Style/GlobalVars
369-
File.write('build/build.log', $compiledb_out.join("\n")) # rubocop:disable Style/GlobalVars
368+
if $compiledb_out.any?
369+
File.write('build/build.log', $compiledb_out.join("\n"))
370370
sh 'compiledb < build/build.log'
371371
end
372372
end

lib/date.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def step(limit, step = 1)
334334
end
335335
end
336336

337-
def strftime(format = '%F') # rubocop:disable Lint/UnusedMethodArgument
337+
def strftime(format = '%F')
338338
__inline__ <<-END
339339
format_var.assert_type(env, Object::Type::String, "String");
340340
struct tm time = { 0 };

lib/fiddle.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def call(*args)
7474
end
7575
end
7676

77-
private # rubocop:disable Lint/UselessAccessModifier
77+
private
7878

7979
# NOTE: currently only supporting the few function signatures that we need for Natalie's REPL
8080
# In the future, Natalie will have macros that will allow this to be generated at compile time.

lib/fileutils.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def self.mkdir_p(path, mode: nil)
2121
mkdir =
2222
lambda do |dir, *args|
2323
Dir.mkdir(dir, *args)
24-
rescue StandardError # rubocop:disable Style/RescueStandardError
24+
rescue StandardError
2525
raise unless File.directory?(dir)
2626
end
2727

lib/json.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ def next_token
136136
case (c = current_char)
137137
when 't'
138138
raise ParserError, "unknown literal: #{c}" unless advance(4) == 'true'
139-
:true # rubocop:disable Lint/BooleanSymbol
139+
:true
140140
when 'f'
141141
raise ParserError, "unknown literal: #{c}" unless advance(5) == 'false'
142-
:false # rubocop:disable Lint/BooleanSymbol
142+
:false
143143
when 'n'
144144
raise ParserError, "unknown literal: #{c}" unless advance(4) == 'null'
145145
:null
@@ -261,9 +261,9 @@ def parse
261261

262262
def parse_sequence(token)
263263
case token
264-
when :true # rubocop:disable Lint/BooleanSymbol
264+
when :true
265265
true
266-
when :false # rubocop:disable Lint/BooleanSymbol
266+
when :false
267267
false
268268
when :null
269269
nil

lib/natalie/compiler/macro_expander.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ def macro_eval(expr:, current_path:, locals:, **)
186186
end
187187
end
188188

189-
def macro_nat_ignore_require(expr:, current_path:) # rubocop:disable Lint/UnusedMethodArgument
189+
def macro_nat_ignore_require(expr:, current_path:)
190190
Prism.false_node(location: nil) # Script has not been loaded
191191
end
192192

193-
def macro_nat_ignore_require_relative(expr:, current_path:) # rubocop:disable Lint/UnusedMethodArgument
193+
def macro_nat_ignore_require_relative(expr:, current_path:)
194194
Prism.false_node(location: nil) # Script has not been loaded
195195
end
196196

lib/natalie/compiler/pass1.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2510,7 +2510,7 @@ def transform_retry_node(*)
25102510
[RetryInstruction.new(id: @retry_context.last)]
25112511
end
25122512

2513-
def transform_return_node(node, used:) # rubocop:disable Lint/UnusedMethodArgument
2513+
def transform_return_node(node, used:)
25142514
[transform_arguments_node_for_returnish(node.arguments, location: node.location), ReturnInstruction.new]
25152515
end
25162516

lib/pathname.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ def +(other)
9999
end
100100

101101
module Kernel
102-
private def Pathname(arg) # rubocop:disable Naming/MethodName
102+
private def Pathname(arg)
103103
Pathname.new(arg)
104104
end
105-
def self.Pathname(arg) # rubocop:disable Naming/MethodName
105+
def self.Pathname(arg)
106106
Pathname.new(arg)
107107
end
108108
end

lib/strscan.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def scan_full(pattern, advance_pointer_p, return_string_p)
181181

182182
alias search_full scan_full
183183

184-
def get_byte # rubocop:disable Naming/AccessorMethodName
184+
def get_byte
185185
@matched = scan(/./)
186186
end
187187

@@ -291,7 +291,7 @@ def clear
291291
terminate
292292
end
293293

294-
def self.must_C_version # rubocop:disable Naming/MethodName
294+
def self.must_C_version
295295
self
296296
end
297297
end

spec/language/block_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ def obj.to_ary; raise "Exception raised in #to_ary" end
751751
end
752752

753753
it "accepts unnamed arguments" do
754-
lambda { |_,_| }.should be_an_instance_of(Proc) # rubocop:disable Style/Lambda
754+
lambda { |_,_| }.should be_an_instance_of(Proc)
755755
-> _,_ {}.should be_an_instance_of(Proc)
756756
Proc.new { |_,_| }.should be_an_instance_of(Proc)
757757
end

spec/language/ensure_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def foo
347347
begin
348348
raise "oops"
349349
ensure
350-
return caller(0, 2) # rubocop:disable Lint/EnsureReturn
350+
return caller(0, 2)
351351
end
352352
end
353353
line = __LINE__

spec/language/execution_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
2.times do
4242
runner.instance_exec do
43-
`test #{:command}` # rubocop:disable Lint/LiteralInInterpolation
43+
`test #{:command}`
4444
end
4545
end
4646

@@ -88,7 +88,7 @@
8888

8989
2.times do
9090
runner.instance_exec do
91-
%x{test #{:command}} # rubocop:disable Lint/LiteralInInterpolation
91+
%x{test #{:command}}
9292
end
9393
end
9494

spec/language/string_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def long_string_literals
254254

255255
describe "Ruby String interpolation" do
256256
it "permits an empty expression" do
257-
s = "#{}" # rubocop:disable Lint/EmptyInterpolation
257+
s = "#{}"
258258
s.should.empty?
259259
s.should_not.frozen?
260260
end

test/encodings/eucjp_tables.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}.freeze
1010

1111
TABLES.each do |table_name, url|
12-
lines = URI.open(url).readlines(chomp: true) # rubocop:disable Security/Open
12+
lines = URI.open(url).readlines(chomp: true)
1313
index = lines.grep_v(/^#|^\s*$/).map(&:split).each_with_object({}) { |(idx, value, *), hash| hash[idx.to_i] = value }
1414

1515
print "static const long #{table_name}[] = {"

test/natalie/argument_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def baz(a)
7777
describe 'underscore args' do
7878
def underscore_arguments(_, _)
7979
_
80-
end # rubocop:disable Lint/UnderscorePrefixedVariableName
80+
end
8181

8282
it 'does not overwrite the first underscore' do
8383
underscore_arguments(1, 2).should == 1

test/natalie/method_visibility_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def public_foo_calling_private_foo
1010
end
1111

1212
def public_foo_calling_private_foo_with_self
13-
self.private_foo # rubocop:disable Style/RedundantSelf
13+
self.private_foo
1414
end
1515

1616
def public_foo_calling_protected_foo

test/natalie/require_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# this is here to test that order of requires goes top-to-bottom
2929
class Foo1Child < Foo1
3030
end
31-
require 'require/simple' # rubocop:disable Lint/DuplicateRequire
31+
require 'require/simple'
3232

3333
# having this top-level variable named the same as the one in simple.rb
3434
# should not cause a compilation error

0 commit comments

Comments
 (0)