Showing 25 of 25 total issues
Unused method argument - type
. If it's necessary, use _
or _type
as an argument name to indicate that it won't be used. You can also write as [](*)
if you want the method to accept any arguments but don't care about them. Open
Open
def [](type)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Unused block argument - m
. You can omit the argument if you don't care about it. Open
Open
watch(%r{^lib/odania/config/(.+)\.rb$}) { |m| 'spec/lib/odania/config/plugin_config_spec.rb' }
- Read upRead up
- Exclude checks
This cop checks for unused block arguments.
Example:
# bad
do_something do |used, unused|
puts used
end
do_something do |bar|
puts :foo
end
define_method(:foo) do |bar|
puts :baz
end
Example:
#good
do_something do |used, _unused|
puts used
end
do_something do
puts :foo
end
define_method(:foo) do |_bar|
puts :baz
end
Do not suppress exceptions. Open
Open
rescue LoadError
- Read upRead up
- Exclude checks
This cop checks for rescue blocks with no body.
Example:
# bad
def some_method
do_something
rescue
# do nothing
end
Example:
# bad
begin
do_something
rescue
# do nothing
end
Example:
# good
def some_method
do_something
rescue
handle_exception
end
Example:
# good
begin
do_something
rescue
handle_exception
end
TODO found Open
Open
# TODO Is there an easier way to get the first service tagges with "core-backend"?
- Exclude checks
TODO found Open
Open
TODO: Write usage instructions here
- Exclude checks