summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Lo <stan001212@gmail.com>2024-02-01 17:45:54 +0000
committergit <svn-admin@ruby-lang.org>2024-02-01 17:46:02 +0000
commitef427123ad51269fd5b45eeba327bd626e420974 (patch)
tree393996181892a58f96db08e3cc73e34b3325e0c7
parent494778c66340be109f4d3bc4e51e57da967e7027 (diff)
[ruby/irb] Add rubocop with a few basic styling rules
(https://github.com/ruby/irb/pull/849) * Use rubocop to enforce a few styling rules * Add a CI job for linting https://github.com/ruby/irb/commit/4f60cd88bb
-rw-r--r--lib/irb/inspector.rb2
-rw-r--r--lib/irb/locale.rb2
-rw-r--r--test/irb/test_input_method.rb1
-rw-r--r--test/irb/test_workspace.rb2
4 files changed, 3 insertions, 4 deletions
diff --git a/lib/irb/inspector.rb b/lib/irb/inspector.rb
index ee3b19efdc..7bdd855b9a 100644
--- a/lib/irb/inspector.rb
+++ b/lib/irb/inspector.rb
@@ -46,7 +46,7 @@ module IRB # :nodoc:
# Determines the inspector to use where +inspector+ is one of the keys passed
# during inspector definition.
def self.keys_with_inspector(inspector)
- INSPECTORS.select{|k,v| v == inspector}.collect{|k, v| k}
+ INSPECTORS.select{|k, v| v == inspector}.collect{|k, v| k}
end
# Example
diff --git a/lib/irb/locale.rb b/lib/irb/locale.rb
index f94aa0f40b..1510af2ab4 100644
--- a/lib/irb/locale.rb
+++ b/lib/irb/locale.rb
@@ -94,7 +94,7 @@ module IRB # :nodoc:
end
end
- def find(file , paths = $:)
+ def find(file, paths = $:)
dir = File.dirname(file)
dir = "" if dir == "."
base = File.basename(file)
diff --git a/test/irb/test_input_method.rb b/test/irb/test_input_method.rb
index 0b52d4cbc3..7644d3176a 100644
--- a/test/irb/test_input_method.rb
+++ b/test/irb/test_input_method.rb
@@ -170,4 +170,3 @@ module TestIRB
end
end
end
-
diff --git a/test/irb/test_workspace.rb b/test/irb/test_workspace.rb
index ff17b1a22c..8c7310578a 100644
--- a/test/irb/test_workspace.rb
+++ b/test/irb/test_workspace.rb
@@ -91,7 +91,7 @@ module TestIRB
irb_path = "#{top_srcdir}/#{dir}/irb"
File.exist?(irb_path)
end or omit 'irb command not found'
- assert_in_out_err(bundle_exec + ['-W0', "-C#{top_srcdir}", '-e', <<~RUBY , '--', '-f', '--'], 'binding.local_variables', /\[:_\]/, [], bug17623)
+ assert_in_out_err(bundle_exec + ['-W0', "-C#{top_srcdir}", '-e', <<~RUBY, '--', '-f', '--'], 'binding.local_variables', /\[:_\]/, [], bug17623)
version = 'xyz' # typical rubygems loading file
load('#{irb_path}')
RUBY