Class: RuboCop::Cop::Chef::Correctness::OctalModeAsString
- Defined in:
- lib/rubocop/cop/chef/correctness/octal_mode_as_string.rb
Overview
Don’t represent file modes as Strings containing octal values.
Constant Summary collapse
- MSG =
"Don't represent file modes as strings containing octal values. Use standard base 10 file modes instead. For example: '0755'."
- RESTRICT_ON_SEND =
[:mode].freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_send(node) ⇒ Object
40 41 42 43 |
# File 'lib/rubocop/cop/chef/correctness/octal_mode_as_string.rb', line 40 def on_send(node) return unless node.arguments.first&.str_type? && node.arguments.first.value.match?(/^0o/) add_offense(node, severity: :refactor) end |