ManageIQ/ovirt

View on GitHub
examples/example_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage

Remove unnecessary require statement.
Open

require 'pp'
Severity: Minor
Found in examples/example_helper.rb by rubocop

Checks for unnecessary require statement.

The following features are unnecessary require statement because they are already loaded. e.g. Ruby 2.2:

ruby -ve 'p $LOADED_FEATURES.reject { |feature| %r|/| =~ feature }'
ruby 2.2.8p477 (2017-09-14 revision 59906) [x86_64-darwin13]
["enumerator.so", "rational.so", "complex.so", "thread.rb"]

Below are the features that each TargetRubyVersion targets.

* 2.0+ ... `enumerator`
* 2.1+ ... `thread`
* 2.2+ ... Add `rational` and `complex` above
* 2.5+ ... Add `pp` above
* 2.7+ ... Add `ruby2_keywords` above
* 3.1+ ... Add `fiber` above
* 3.2+ ... `set`

This cop target those features.

Example:

# bad
require 'unloaded_feature'
require 'thread'

# good
require 'unloaded_feature'

There are no issues that match your filters.

Category
Status