class RuboCop::Cop::Chef::Correctness::OctalModeAsString
Don’t represent file modes as Strings containing octal values.
@example
#### incorrect file '/etc/some_file' do mode '0o755' end #### correct file '/etc/some_file' do mode '0755' end
Constants
- MSG
- RESTRICT_ON_SEND
Public Instance Methods
on_send(node)
click to toggle source
# 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