Chef/Modernize/UseRequireRelative
The Cookstyle cops department: Chef/Modernize
Enabled by default | Supports autocorrection | Target Chef Version |
---|---|---|
Enabled | Yes | All Versions |
Instead of using require with a File.expand_path and FILE use the simpler require_relative method.
Examples
incorrect
require File.expand_path('../../libraries/helpers', __FILE__)
correct
require_relative '../libraries/helpers'
Configurable attributes
Name | Default value | Configurable values |
---|---|---|
Version Added | 5.22.0 | String |
Include | Array |