Class: RuboCop::Cop::Facter::FacterUtil
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Facter::FacterUtil
- Defined in:
- lib/rubocop/cop/facter/facter_util.rb
Overview
Check that custom facts do not require files in facter/util, as they’ve all been removed in cfacter.
Constant Summary collapse
- MSG =
rubocop:disable Metrics/LineLength
'Functionality under facter/util has been mostly removed and must be implemented at the fact-level'.freeze
Instance Method Summary collapse
-
#on_send(node) ⇒ Object
rubocop:enable Metrics/LineLength.
Instance Method Details
#on_send(node) ⇒ Object
rubocop:enable Metrics/LineLength
17 18 19 20 21 |
# File 'lib/rubocop/cop/facter/facter_util.rb', line 17 def on_send(node) _receiver, method_name, *args = *node add_offense(node, :selector) if (method_name == :require && _receiver == nil && args.first.children.first =~ /facter\/util/) end |